From 942ab36310980e388ab9628fa67cbf52ef48c427 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Wed, 19 Jun 2024 16:36:00 +0200 Subject: [PATCH] bugfixing --- app/GetStartEndDate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/GetStartEndDate.py b/app/GetStartEndDate.py index 6c43d11..c6c8aa0 100755 --- a/app/GetStartEndDate.py +++ b/app/GetStartEndDate.py @@ -26,9 +26,7 @@ def check_if_holiday(self): return None def correct_1d_interval(self, holiday): - if holiday in ('independence_day', 'independence_day+1'): - start_date_1d = datetime(2023, 6, 18) - elif holiday in ('labor_day', 'labor_day+1'): + if holiday in ('labor_day', 'labor_day+1'): start_date_1d = datetime(2023, 9, 1) elif holiday == 'thanks_giving': start_date_1d = datetime(2023, 11, 22) @@ -40,6 +38,8 @@ def correct_1d_interval(self, holiday): start_date_1d = datetime(2024, 2, 16) elif holiday == 'memorial_day': start_date_1d = datetime(2024, 5, 24) + elif holiday in ('independence_day', 'independence_day+1'): + start_date_1d = datetime(2024, 6, 18) else: current_time_new_york = datetime.now(self.new_york_tz) current_weekday = current_time_new_york.weekday() @@ -61,7 +61,6 @@ def run(self): is_afternoon = current_time_new_york.hour > 9 or (current_time_new_york.hour == 9 and current_time_new_york.minute >= 30) if holiday: holiday_dates = { - 'independence_day': datetime(2023, 6, 18), 'labor_day': datetime(2023, 9, 1), 'labor_day+1': datetime(2023, 9, 1), 'thanks_giving': datetime(2023, 11, 22), @@ -70,6 +69,7 @@ def run(self): 'martin_luther_king': datetime(2024, 1, 12), 'washington_birthday': datetime(2024, 2, 16), 'memorial_day': datetime(2024, 5, 24), + 'independence_day': datetime(2024, 6, 18), } if holiday in holiday_dates: