Skip to content

Commit 15fb43c

Browse files
authored
Merge pull request #45 from Clav3rbot/fix/schedule-utc-timezone
fix: normalize schedule date_utc to ISO 8601 with Z suffix for correct browser timezone conversion
2 parents a9df08f + 50445db commit 15fb43c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

backend/routers/sessions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ def _build_events(year: int) -> dict:
5757
else:
5858
session["available"] = False
5959

60+
# Normalize date_utc to ISO 8601 with "Z" so the browser
61+
# correctly interprets them as UTC and converts to local time
62+
for session in evt.get("sessions", []):
63+
d = session.get("date_utc")
64+
if d and not d.endswith("Z"):
65+
session["date_utc"] = d.replace(" ", "T") + "Z"
66+
6067
if has_past_session:
6168
evt["status"] = "available"
6269
last_past_idx = i

0 commit comments

Comments
 (0)