Calendar highlights the wrong "today" in the evening west of UTC #166
Labels
No labels
area/ai
area/backend
area/frontend
area/infra
area/scheduler
area/wled
good-first-issue
priority/high
priority/low
priority/medium
security
type/bug
type/chore
type/ci-cd
type/docs
type/feature
type/qa
v1.0.0
v1.1.0
v1.2.0
v2.0.0
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/Iris-WLED#166
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
YearCalendar'sTODAYis computed withnew 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
tzsetting, the same one the scheduler uses and the backend'slocal_todayfrom #162), not the browser's UTC conversion. Either expose it via the settings API and format withIntl.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.