fix breakage on sunday

master
Tomáš Mládek 2021-05-23 11:01:27 +02:00
parent c8f8045022
commit 034bf2129a
1 changed files with 4 additions and 2 deletions

View File

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