Skip to content

fix: classes missing from calendar (Schedule-X timezone mismatch) - #181

Open
jdawit wants to merge 1 commit into
rchalamala:mainfrom
jdawit:fix/calendar-timezone
Open

jdawit wants to merge 1 commit into
rchalamala:mainfrom
jdawit:fix/calendar-timezone

Conversation

@jdawit

@jdawit jdawit commented Oct 3, 2026 •

Copy link
Copy Markdown

Problem

Since the Schedule-X migration, added courses don't appear on the calendar for anyone outside UTC. The course card shows up, but the week grid stays empty.

Repro on caltech.dev (browser in Pacific time): add Ma 102 (MWF 10:00–10:55, R 09:00–09:55). The events exist in the DOM but are labelled 6:00 PM / 5:00 PM and positioned at top: 128%, below the visible grid.

Cause

In src/Planner.tsx:

  • events are built as Temporal.ZonedDateTime in the browser's zone (Temporal.Now.timeZoneId())
  • useCalendarApp doesn't set timezone, so Schedule-X uses its default, UTC, and converts every event into it (+8h for Pacific in January 2018)
  • dayBoundaries / gridHeight are computed from the local hours, so the shifted events fall outside the rendered range

Users east of UTC get the opposite shift.

Fix

Catalog times are floating wall-clock times, so use one fixed zone ("UTC") for both the events and the calendar (timezone: timeZone). That's 5 lines, no dependency changes, and it doesn't touch the .ics export, which handles America/Los_Angeles separately in Workspace.tsx.

This is a minimal alternative to reverting the whole modernization stack (#180): the new stack works once the timezone mismatch is fixed.

Testing

  • npm run build passes
  • Built and ran locally with the browser in America/Los_Angeles: Ma 102 renders at MWF 10:00 AM and Thu 9:00 AM inside the grid
  • Running live with this change: https://jdawit.github.io/caltech.dev/

🤖 Generated with Claude Code


Devin Review

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 <noreply@anthropic.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

This branch has not been deployed

No deployments
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.

1 participant