Skip to content
Snippets Groups Projects
Commit 8c2aba15 authored by tuhe's avatar tuhe
Browse files

removed

parents d4bee0aa 4eb97ecb
No related branches found
No related tags found
No related merge requests found
Showing
with 23 additions and 1 deletion
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -98,7 +98,7 @@ def first_day_of_class(info):
mo_first = datetime(year=year(), month=1 if semester() == 'spring' else 8, day=1, hour=info.get('lecture_start_hour', 13), minute=0)
# scroll to monday
while mo_first.weekday() != 0: #strftime('%A') is not 'Monday':
mo_first -= timedelta(days=1)
mo_first += timedelta(days=1) # Don't subtract here.
# add 4 weeks to get into 13 week period
for _ in range(4):
mo_first += timedelta(days=7)
......@@ -169,6 +169,7 @@ def lectures(info, pensum=None):
l['day'] = d.day
l['date'] = d
l['preceded_by_holiday'] = i == holiday
l['followed_by_holiday'] = i+1 == holiday
l = {**l, **date2format(d)}
if not continuing_education():
......@@ -469,6 +470,27 @@ def class_information(verbose=False,
d['sections'] = sections
# current_lecture = -2
from datetime import timedelta
# l['date'] - datetime.timedelta(days=7)
# Long before firrst.
# if d['lectures'][0]['date'] - timedelta(days=7) < datetime.now():
# current_lecture = -1 # More than a week to semester start.
current_lecture = -1
if d['lectures'][0]['date'] - timedelta(days=7) < datetime.now():
current_lecture = 0 # Less than a week to start.
for k, l in enumerate(d['lectures']):
# current_lecture = l['number']
if datetime.now() >= l['date']:
current_lecture = l['number']
else:
break
d['current_lecture_number'] = current_lecture
d['last_held_lecture'] = current_lecture
return d
def _update_with_core_conf(d):
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment