From 98631a3b2f1cc95d4280b454f92be2db327fd65e Mon Sep 17 00:00:00 2001 From: Adam Moussa <166072409+amoussa1229@users.noreply.github.com> Date: Tue, 12 May 2026 17:13:19 -0400 Subject: [PATCH] Fix weekend day shift active window to 8am-5pm Before midnight-8am on weekends incorrectly reported the day shift as active when the previous night shift is still running. --- src/ring-scheduler/app.py | 2 +- src/slack-bot/app.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ring-scheduler/app.py b/src/ring-scheduler/app.py index c58f7aa..9517d31 100644 --- a/src/ring-scheduler/app.py +++ b/src/ring-scheduler/app.py @@ -23,7 +23,7 @@ WEEKEND_DAYS = {"Saturday", "Sunday"} def determine_shift_type(now: datetime) -> str: day_name = now.strftime("%A") - if day_name in WEEKEND_DAYS and now.hour < 17: + if day_name in WEEKEND_DAYS and 8 <= now.hour < 17: return "day" return "night" diff --git a/src/slack-bot/app.py b/src/slack-bot/app.py index 0124070..e51e9cf 100644 --- a/src/slack-bot/app.py +++ b/src/slack-bot/app.py @@ -95,7 +95,7 @@ def _is_active_shift_type(shift_type: str) -> bool: """Check if the given shift type is the currently active one.""" now = datetime.now(EASTERN) day_name = now.strftime("%A") - if day_name in WEEKEND_DAYS and now.hour < 17: + if day_name in WEEKEND_DAYS and 8 <= now.hour < 17: return shift_type == "day" return shift_type == "night"