Skip to content
Snippets Groups Projects
Commit 4eb97ecb authored by tuhe's avatar tuhe
Browse files

fixed last_held_lecture

parent 854eba6c
No related branches found
No related tags found
No related merge requests found
Showing
with 16 additions and 3 deletions
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
...@@ -470,14 +470,27 @@ def class_information(verbose=False, ...@@ -470,14 +470,27 @@ def class_information(verbose=False,
d['sections'] = sections d['sections'] = sections
current_lecture = -2 # 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']): for k, l in enumerate(d['lectures']):
current_lecture = k - 1 # current_lecture = l['number']
if l['date'] >= datetime.now(): if datetime.now() >= l['date']:
current_lecture = l['number']
else:
break break
d['current_lecture_number'] = current_lecture d['current_lecture_number'] = current_lecture
d['last_held_lecture'] = current_lecture
return d return d
def _update_with_core_conf(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
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