Fix deterministic editorial date formatting - #56
Merged
Conversation
Greptile SummaryCentralizes editorial date rendering around an America/Toronto formatter to prevent server/client calendar-day differences.
Confidence Score: 5/5The PR appears safe to merge, with the affected date paths consistently using the intended editorial timezone. The shared formatter handles invalid inputs, preserves date-only chart periods, and runs on supported Node.js and browser targets; no concrete blocking or non-blocking defect remains.
|
| Filename | Overview |
|---|---|
| src/lib/date-format.ts | Introduces deterministic Toronto date formatters and safely preserves bare calendar dates through noon-UTC anchoring. |
| src/app/memos/[slug]/MemoEngagement.tsx | Replaces UTC engagement-date formatting with the shared editorial timezone behavior. |
| src/app/state-of-the-nation/canvas/OverlayChart.tsx | Routes monthly tooltip labels through the shared deterministic formatter. |
| src/app/state-of-the-nation/og-card.tsx | Uses shared month formatting for chart labels while retaining the annual fallback for invalid or absent dates. |
| src/app/memos/types.ts | Makes memo-list date formatting deterministic across server and browser rendering. |
| src/components/feed/types.ts | Makes feed-card publication dates deterministic in the editorial timezone. |
| src/components/ui/memo-card.tsx | Consolidates existing Toronto memo-card formatting into the shared helper without changing fallback behavior. |
Reviews (1): Last reviewed commit: "Fix deterministic editorial date formatt..." | Re-trigger Greptile
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.
Summary
Why
React hydration error 418 was caused by server and browser renders selecting different calendar days for the same timestamp. Recent PostHog samples reference an older cached bundle, but additional unpinned client date formatters remained in the current code.
Validation