Commit 0013627e authored by Daniel W Bond's avatar Daniel W Bond
Browse files

created a function to return a string indicating the semester of a date passed...

created a function to return a string indicating the semester of a date passed in-- based on mason's calendar
parent c5d7f242
......@@ -20,6 +20,21 @@ settings_redirect = """You've already finished the welcome walkthrough.
Your user settings can now be changed here on this page."""
def get_semester(date):
# months are between 1 and 12, inclusive
semesters = {
'Spring': (1, 2, 3, 4, 5),
'Summer': (6, 7),
'Fall': (8, 9, 10, 11, 12)
}
for semester, months in semesters.iteritems():
if date.month in months:
semester_string = semester
return semester_string
class WelcomeName(LoginRequiredMixin, FormView):
"""Student adds first and last name, and gender and gender display."""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment