Skip to content

fix: normalize schedule date_utc to ISO 8601 with Z suffix for correct browser timezone conversion#45

Merged
adn8naiagent merged 1 commit intoadn8naiagent:devfrom
Clav3rbot:fix/schedule-utc-timezone
Mar 16, 2026
Merged

fix: normalize schedule date_utc to ISO 8601 with Z suffix for correct browser timezone conversion#45
adn8naiagent merged 1 commit intoadn8naiagent:devfrom
Clav3rbot:fix/schedule-utc-timezone

Conversation

@Clav3rbot
Copy link
Copy Markdown
Contributor

@Clav3rbot Clav3rbot commented Mar 15, 2026

Problem

The \date_utc\ values in the static schedule JSON files (e.g. \data/seasons/2026/schedule.json) use the format \2026-03-15 07:00:00\ without a timezone indicator. When the frontend receives these values, JavaScript's
ew Date('2026-03-15 07:00:00')\ treats them as local time instead of UTC, so users see raw UTC times instead of their local timezone.

Fix

Normalize \date_utc\ strings in _build_events()\ before returning the response:

  • Replace space separator with \T\ (ISO 8601)
  • Append \Z\ suffix to indicate UTC

This ensures the frontend's \ FormatLocalTime()\ function correctly interprets dates as UTC and converts them to the user's local timezone via \ oLocaleTimeString().

Example

  • Before: \2026-03-15 07:00:00\ → browser shows 7:00 AM (wrong, treated as local time)
  • After: \2026-03-15T07:00:00Z\ → browser shows 8:00 AM CET (correct UTC→local conversion)

@adn8naiagent adn8naiagent merged commit 15fb43c into adn8naiagent:dev Mar 16, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants