From ad743623454efdaea1c11fda9293173922d718cc Mon Sep 17 00:00:00 2001 From: Rohan Padhye Date: Fri, 1 Mar 2024 22:48:21 -0500 Subject: [PATCH] Fix weekly schedule update Should not break build on leap days: https://twitter.com/michaelhilton/status/1763679473990525143 https://twitter.com/moarbugs/status/1763770494937862324 @MichaelHilton --- docs/_data/update_this_week.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_data/update_this_week.py b/docs/_data/update_this_week.py index ba17bcb9b..05631658f 100644 --- a/docs/_data/update_this_week.py +++ b/docs/_data/update_this_week.py @@ -3,7 +3,7 @@ def add_business_days(start_date, add_days, current_year): rem_days_to_add = add_days - current_date = datetime.strptime(start_date, "%a %b %d").replace(year=current_year) + current_date = datetime.strptime("%s %s" % (start_date, current_date.year), "%a %b %d %Y") while rem_days_to_add > 0: current_date += timedelta(days=1) @@ -43,7 +43,7 @@ def ignore_aliases(self, data): current_date = start_date for schedule_day in schedule: - schedule_date = datetime.strptime(schedule_day['date'], "%a %b %d").replace(year=current_date.year) + schedule_date = datetime.strptime("%s %s" % (schedule_day['date'], current_date.year), "%a %b %d %Y") if not week_start_date and schedule_date > current_date: # We're at the current week! week_start_date = schedule_date