From 9edf974aa31ec32025c17e7831f7b4b34e28131f Mon Sep 17 00:00:00 2001 From: Rykov7 Date: Mon, 22 Aug 2022 20:19:19 +0300 Subject: [PATCH] fix programmer's day to 256-th in leap-years --- app/reminder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/reminder.py b/app/reminder.py index c090fec..fd6fdf4 100644 --- a/app/reminder.py +++ b/app/reminder.py @@ -23,6 +23,8 @@ def remind(chat_to_repeat=PYTHONCHATRU, today=dt.today()): holidays = tuple(csv.reader(holidays_file))[1:] for entry in holidays: date, holiday, description = entry + if holiday == 'День программиста' and today.year % 4 == 0: + date = '09-12-1000' # instead of 09-13-1000 in non-leap-year date = dt.strptime(date, "%m-%d-%Y") if today.month == date.month and today.day == date.day: notification = f'🎉💻 Сегодня {holiday.upper()}!\