Conversation
Fourteen call sites each spelled out their own Intl options and had drifted
apart: some passed "en-US" and some passed undefined, and three fell back to
the bare toLocaleDateString()/toLocaleString() default ("8/17/2026") inside a
UI that reads "Aug 17, 2026" everywhere else.
lib/format/date.ts now owns the seven shapes actually in use. Each is named
for its output rather than its caller, so a new call site can pick one by
reading the sample.
Two deliberate behavior changes come with this:
- Locale and timezone are pinned rather than left to the runtime. An
undefined locale resolves to the server's locale during SSR and the
browser's on hydration, so every timestamp rendered on both sides was a
hydration mismatch waiting to happen. Verified: formatter output is now
identical under TZ=UTC and TZ=America/Los_Angeles.
- Timestamps read in event-local time for everyone. Previously an organizer
in California saw different clock times than one in Ann Arbor for the same
moment, and invite-expiry emails — rendered on the server — went out in the
container's zone while labelling themselves with timeZoneName: "short".
The event timezone is hardcoded here for now; it moves to lib/config/event.ts
in the next commit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.