brackt/app/hooks
chrisp 08ae2bb88a
All checks were successful
🚀 Deploy / ʦ🔍 Typecheck & Lint (push) Successful in 1m38s
🚀 Deploy / 🧪 Test (push) Successful in 3m30s
🚀 Deploy / 🐳 Build (push) Successful in 1m9s
🚀 Deploy / 🚀 Deploy (push) Successful in 11s
Fix SSR/hydration timezone flip in event date and time display (#95)
## Summary

- Adds `useHasMounted` hook (using `useSyncExternalStore` — no extra render cycle) to gate UTC timestamp formatting to client-only
- Fixes the visible time-flip in `EventSchedule` and `UpcomingCalendarPanel` where SSR rendered UTC time (e.g. "9:00 PM") and the client re-rendered with local time (e.g. "2:00 PM PDT") after hydration, with `suppressHydrationWarning` silently hiding the mismatch
- Fixes `formatEventDate` in `date-utils.ts` (and `EventSchedule`'s private copy) to parse `YYYY-MM-DD` strings as local midnight instead of UTC midnight, correcting an off-by-one day bug for UTC-negative users across all callers

## Test plan

- [ ] Navigate to a sports season page — confirm event times show in local timezone with no flash/flip on load
- [ ] Hard-reload the page — confirm no brief UTC time visible before settling on local time
- [ ] Check the home page `UpcomingCalendarPanel` — confirm same behavior
- [ ] Verify dates display correctly (e.g. no "Jun 17" showing for a "Jun 18" event near midnight UTC)

Co-authored-by: Chris Parsons <chrisparsons1127@gmail.com>
Reviewed-on: #95
2026-06-17 06:09:29 +00:00
..
__tests__ Fix unhandled rejection from session ping when network is unavailable (#56) 2026-05-27 16:14:14 +00:00
useDraftAuthRecovery.ts Fix unhandled rejection from session ping when network is unavailable (#56) 2026-05-27 16:14:14 +00:00
useDraftNotifications.ts Fix oxlint warnings: no-shadow, consistent-function-scoping, no-non-null-assertion, and others (#196) 2026-03-21 10:59:51 -07:00
useDraftRoomState.ts Show "Syncing Draft State..." overlay during draft reconnection (#361) 2026-04-30 20:33:00 -07:00
useDraftSocket.ts Change Socket.IO connection error logging from error to log level (#448) 2026-05-19 15:47:41 -07:00
useDraftSocketEvents.ts Fix three timer-pause gaps found in code review 2026-06-06 08:52:04 -07:00
useFocusTrap.ts fix: resolve all 48 WCAG 2.2 AA accessibility issues (#439) 2026-05-17 20:11:38 -07:00
useHasMounted.ts Fix SSR/hydration timezone flip in event date and time display (#95) 2026-06-17 06:09:29 +00:00
useLocalTimezone.ts Simplify sports season display and add local timezone hints (#434) 2026-05-15 16:04:07 -07:00
useMediaQuery.ts
useRoundTransition.ts Add Storybook stories for new components from staged changes (#321) 2026-04-23 22:09:25 -07:00
useSortableData.ts Fix oxlint errors. 2026-03-22 20:41:44 -07:00