diff --git a/app/components/sport-season/GroupStageStandings.tsx b/app/components/sport-season/GroupStageStandings.tsx index 4931914..74733e8 100644 --- a/app/components/sport-season/GroupStageStandings.tsx +++ b/app/components/sport-season/GroupStageStandings.tsx @@ -1,3 +1,4 @@ +import { useState, useEffect } from "react"; import type { GroupStandingsRow } from "~/models/group-stage-match"; import { TeamOwnerBadge } from "~/components/ui/team-owner-badge"; @@ -38,6 +39,23 @@ function MatchResult({ match }: { match: GroupMatch }) { const p1 = match.participant1?.name ?? "?"; const p2 = match.participant2?.name ?? "?"; + // SSR renders UTC time (stable); useEffect replaces with the user's local time after hydration. + const [kickoffDisplay, setKickoffDisplay] = useState(() => + match.scheduledAt + ? new Date(match.scheduledAt).toLocaleTimeString("en-US", { + hour: "numeric", + minute: "2-digit", + timeZone: "UTC", + }) + : null + ); + useEffect(() => { + if (!match.scheduledAt) return; + setKickoffDisplay( + new Date(match.scheduledAt).toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" }) + ); + }, [match.scheduledAt]); + if (match.isComplete && match.participant1Score !== null && match.participant2Score !== null) { const s1 = match.participant1Score; const s2 = match.participant2Score; @@ -61,7 +79,6 @@ function MatchResult({ match }: { match: GroupMatch }) { ); } - const kickoff = match.scheduledAt ? new Date(match.scheduledAt) : null; return (
- {day} -
- {matches.map((m) => ( -+ {dayLabel} +
+ {matches.map((m) => ( +