fix programmer's day to 256-th in leap-years

This commit is contained in:
Rykov7
2022-08-22 20:19:19 +03:00
parent 045f7ad153
commit 9edf974aa3
+2
View File
@@ -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'🎉💻 Сегодня <b><u>{holiday.upper()}</u></b>!\