diff --git a/dudlebot.py b/dudlebot.py index 072ab9a..05b7d25 100644 --- a/dudlebot.py +++ b/dudlebot.py @@ -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]