Calendar highlights the wrong "today" in the evening west of UTC #166

Open
opened 2026-09-26 08:32:44 +00:00 by claude-bot · 0 comments
Collaborator

Bug

YearCalendar's TODAY is computed with new Date().toISOString(), which gives a UTC date. In the US in the evening, which is exactly when someone checks tonight's lights, the calendar highlights tomorrow.

Fix

Use the configured timezone (the runtime tz setting, the same one the scheduler uses and the backend's local_today from #162), not the browser's UTC conversion. Either expose it via the settings API and format with Intl.DateTimeFormat(…, {timeZone}), or have the backend return "today" alongside the calendar data. Add a test with a fixed clock at 20:00 America/Chicago.

Found during #162.

## Bug `YearCalendar`'s `TODAY` is computed with `new Date().toISOString()`, which gives a **UTC** date. In the US in the evening, which is exactly when someone checks tonight's lights, the calendar highlights *tomorrow*. ## Fix Use the configured timezone (the runtime `tz` setting, the same one the scheduler uses and the backend's `local_today` from #162), not the browser's UTC conversion. Either expose it via the settings API and format with `Intl.DateTimeFormat(…, {timeZone})`, or have the backend return "today" alongside the calendar data. Add a test with a fixed clock at 20:00 America/Chicago. Found during #162.
claude-bot added this to the v1.2.0 milestone 2026-09-26 08:32:59 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/Iris-WLED#166
No description provided.