From 53a99b68c7ee53f072cb26b3a7a6a465af669717 Mon Sep 17 00:00:00 2001 From: tesence Date: Mon, 6 Jan 2025 19:26:02 +0100 Subject: [PATCH] Properly reset week at 9pm EST on friday --- gumo/modules/league.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gumo/modules/league.py b/gumo/modules/league.py index 71dfc13..3a22ef6 100644 --- a/gumo/modules/league.py +++ b/gumo/modules/league.py @@ -84,7 +84,7 @@ def get_current_week_start_date(): Returns: date: Friday of the current week """ - return get_week_start_date(datetime.now(EASTERN_TZ)) + return get_week_start_date(datetime.now(EASTERN_TZ) - timedelta(hours=21)) def get_week_start_date(date): """Return the date when the given league week started (previous friday) @@ -92,8 +92,7 @@ def get_week_start_date(date): Returns: date: Friday of the current week """ - now = date - timedelta(hours=21) - last_friday = now - timedelta(days=(now.weekday() - 4 + 7) % 7) + last_friday = date - timedelta(days=(date.weekday() - 4 + 7) % 7) return last_friday.strftime('%Y-%m-%d') async def _wrap_query(method, query, *params):