claude/practical-newton-4v041g #98

Merged
chrisp merged 3 commits from claude/practical-newton-4v041g into main 2026-06-18 02:33:06 +00:00
Owner
No description provided.
chrisp added 2 commits 2026-06-18 01:44:06 +00:00
The admin group-stage schedule form submitted the raw datetime-local
string, which the server parsed with new Date() in the server's timezone
(UTC), so an admin's local wall-clock time was stored as if it were UTC.
Downstream displays then correctly converted UTC->local, shifting times
by the admin's UTC offset (e.g. 7 PM PDT showed as 12 PM).

Mirror the existing playoff "add-game" form: convert local->UTC on the
client via localDateTimeToUtcIso into a hidden field on submit, and
render the stored UTC value back into the input in the browser's local
timezone via a client-only effect (avoids SSR hydration mismatch).

Adds utcIsoToLocalDateTime helper (inverse of localDateTimeToUtcIso)
with unit tests covering nullish/invalid input and a tz-independent
round-trip.

Note: matches saved before this fix must be re-saved once in admin to
correct their stored values.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0125nZohVD2Cpoq3Q9f4jeds
Migrate existing group-match times and localize day headers
Some checks failed
🚀 Deploy / 🧪 Test (pull_request) Successful in 3m23s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Failing after 50s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
24ca6622e4
Add a one-off data migration (scripts/fix-group-match-times-utc.mjs) that
shifts group_stage_matches.scheduled_at +7h, converting the pre-fix
local-wall-time-as-UTC (all entered in PDT) into true UTC. Scoped to
group-stage matches only; playoff games were already stored correctly.
Defaults to a dry-run preview and only writes with --apply.
Run: npx dotenv -- node scripts/fix-group-match-times-utc.mjs [--apply]

Fix GroupStageStandings day-header grouping/labels, which keyed and
formatted by UTC date. With times now stored as true UTC, an evening PDT
match rolled into the next UTC day and appeared under the wrong header.
Group and label by the viewer's local date after hydration, keeping the
UTC representation on SSR/first paint for deterministic markup.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0125nZohVD2Cpoq3Q9f4jeds
chrisp added 1 commit 2026-06-18 02:19:10 +00:00
Fix lint: move pad helper to module scope in date-utils
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m58s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Successful in 1m25s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
0397da22fb
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
chrisp force-pushed claude/practical-newton-4v041g from 0397da22fb to edae04057d 2026-06-18 02:19:33 +00:00 Compare
chrisp merged commit d31c23d63b into main 2026-06-18 02:33:06 +00:00
chrisp referenced this pull request from a commit 2026-06-18 02:33:06 +00:00
Sign in to join this conversation.
No description provided.