summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.py b/main.py
index d56cf99..a4912ec 100755
--- a/main.py
+++ b/main.py
@@ -17,6 +17,8 @@ def getnextdayn(d,n):
return (d+timedelta(days=n))
def formatday(d):
return d.strftime(i["output"]["date_format"])
+def getweek(d):
+ return d.isocalendar().week + i["output"]["week_drift"]
def getassign(d):
val=""
for a in i["assignments"]:
@@ -57,7 +59,7 @@ if not i["output"]["tables"]["calendar"]["hidden"]:
sstart=parse_date(i["semester"]["start"])
send=parse_date(i["semester"]["end"])
d=sstart
- w=d.isocalendar().week
+ w=getweek(d)
o=i["output"]["tables"]["calendar"]
if o["semester_dates_as_events"]:
i["events"]["sstart_098888986"]={} # Add random numbers to avoid clash with users entries
@@ -126,6 +128,6 @@ if not i["output"]["tables"]["deadlines"]["hidden"]:
msg=i["output"]["tables"]["deadlines"]["msg_handout"].format(a)
else:
msg=i["output"]["tables"]["deadlines"]["msg_deadline"].format(a)
- t.add_row([d.isocalendar().week,formatday(d),msg])
+ t.add_row([getweek(d),formatday(d),msg])
t.align["Assignment"] = "l"
print(t.get_formatted_string(i["output"]["format"]))