fix: label a daily pip in game-day space, not the reader's zone
A day key is a game-day, not an instant, but the pip's title and aria-label were formatted in the browser's timezone. Every reader west of UTC saw a pip reading "12" whose screen-reader label said "Aug 11" — including the whole `america` region these checklists are scoped to. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
1bc7b0057c
commit
99786f6fc9
@@ -135,9 +135,14 @@ function DayPip({
|
|||||||
}) {
|
}) {
|
||||||
const isToday = day === today;
|
const isToday = day === today;
|
||||||
const isFuture = day > today;
|
const isFuture = day > today;
|
||||||
|
// Rendered in UTC on purpose. A day key is a game-day, not an instant, and
|
||||||
|
// formatting it in the reader's own zone shifts it a day backwards for
|
||||||
|
// everyone west of UTC — so the pip would read "12" while the label a screen
|
||||||
|
// reader announces said "Aug 11".
|
||||||
const label = new Date(`${day}T00:00:00Z`).toLocaleDateString(undefined, {
|
const label = new Date(`${day}T00:00:00Z`).toLocaleDateString(undefined, {
|
||||||
day: "numeric",
|
day: "numeric",
|
||||||
month: "short",
|
month: "short",
|
||||||
|
timeZone: "UTC",
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user