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.
This commit is contained in:
Adam Moussa 2026-05-12 17:13:19 -04:00
parent 745f8cd31e
commit 98631a3b2f
2 changed files with 2 additions and 2 deletions

View file

@ -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"

View file

@ -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"