fix breakage on sunday

This commit is contained in:
Tomáš Mládek 2021-05-23 11:01:27 +02:00
parent c8f8045022
commit 034bf2129a

View file

@ -36,9 +36,11 @@ class DudleBot:
update.message.reply_text("There's a plan unresolved still! (Speak /endplan to fix it.)") update.message.reply_text("There's a plan unresolved still! (Speak /endplan to fix it.)")
return return
today = datetime.today()
periods = { periods = {
'thisweek': datetime.today() - timedelta(days=datetime.today().weekday() % 6), 'thisweek': today - timedelta(days=today.weekday()),
'nextweek': datetime.today() + timedelta(days=7) - timedelta(days=datetime.today().weekday() % 6) 'nextweek': today + timedelta(days=7) - timedelta(days=today.weekday())
} }
period = update.message.text.partition(' ')[2] period = update.message.text.partition(' ')[2]