From 3dc9f97fee5da1eab146458571868f6eb3b99776 Mon Sep 17 00:00:00 2001 From: jdawit <89542300+jdawit@users.noreply.github.com> Date: Sat, 3 Oct 2026 13:04:36 -0700 Subject: [PATCH] fix: calendar events missing / shifted by UTC offset Schedule-X v4 defaults the calendar timezone to UTC, but events were built in the browser's local zone, so every class was shifted by the local UTC offset (e.g. +8h in Pacific) and fell outside the visible dayBoundaries. Use a fixed zone for both events and the calendar. Co-Authored-By: Claude Opus 5.5 --- src/Planner.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Planner.tsx b/src/Planner.tsx index f56d6ee..c72b107 100644 --- a/src/Planner.tsx +++ b/src/Planner.tsx @@ -78,7 +78,10 @@ function CourseToDates(courses: CourseStorage[]): DateData[] { return dates; } -const timeZone = Temporal.Now.timeZoneId(); +// Catalog times are floating wall-clock times; render them in a fixed zone and +// tell Schedule-X to use the same one (its default is UTC, and a mismatch with +// the browser zone shifts every event by the UTC offset) +const timeZone = "UTC"; function toZonedDateTime(date: Date): Temporal.ZonedDateTime { return Temporal.ZonedDateTime.from({ @@ -138,6 +141,7 @@ function ScheduleCalendar({ calEvents }: { calEvents: DateData[] }) { const calendar = useCalendarApp({ views: [createViewWeek()], selectedDate: Temporal.PlainDate.from("2018-01-01"), + timezone: timeZone, firstDayOfWeek: 1, dayBoundaries: { start: `${String(minHour).padStart(2, "0")}:00`,