fix: print the date the countdown is actually counting to

The detail sheet formatted the stored ISO, so a day-precision end rendered
as 00:00Z — the previous day for every reader west of UTC, and now a
different day from the timer sitting beside it. Both dates come off the
clock instead, which resolves them the same way.

The note under them said the end was "accurate to the day only" and left
it there. It can say where the count actually lands, and should: a reader
deciding whether to log in tonight wants the reset, not a shrug. It still
says this is a reading rather than a time the source printed.

REGION_LABEL moves next to the region table it names, which is also how
the note gets "Europe" rather than the raw id.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
Lucas Winther
2026-08-18 21:48:48 +02:00
co-authored by Claude Opus 5
parent 4334988ecf
commit 7a90158139
3 changed files with 36 additions and 13 deletions
+4 -5
View File
@@ -1,14 +1,13 @@
import type { LaneId } from "../../shared/custom.ts";
import type { Region } from "../../shared/schema.ts";
import { REGION_LABEL } from "../../shared/time.ts";
import { useGameMeta } from "../state/gameMeta.tsx";
import type { Prefs } from "../state/usePrefs.ts";
import { YourOwn } from "./YourOwn.tsx";
const REGIONS: Array<{ id: Region; label: string }> = [
{ id: "america", label: "America" },
{ id: "europe", label: "Europe" },
{ id: "asia", label: "Asia" },
];
const REGIONS: Array<{ id: Region; label: string }> = (
["america", "europe", "asia"] as const
).map((id) => ({ id, label: REGION_LABEL[id] }));
export function Controls({
games,
+15 -6
View File
@@ -8,7 +8,11 @@ import {
} from "../../shared/custom.ts";
import type { EventDraft } from "../state/useCustom.ts";
import { EventForm } from "./CustomForms.tsx";
import { formatAbsolute, formatRemaining } from "../../shared/time.ts";
import {
formatAbsolute,
formatRemaining,
REGION_LABEL,
} from "../../shared/time.ts";
import type { RowEvent } from "./EventRow.tsx";
import { pressure, pressureReason, type Effort } from "../../shared/effort.ts";
import type { Status } from "../state/useProgress.ts";
@@ -132,14 +136,17 @@ export function EventDetail({
</div>
<dl className="mt-5 grid grid-cols-2 gap-x-4 gap-y-3 text-sm">
{/* Off the clock, not off the event: a day-precision boundary is
resolved to the game's reset there, and printing the stored
00:00Z instead would name a different day to the countdown. */}
<Field label="Starts">
{formatAbsolute(event.startsAt, event.startPrecision === "exact")}
{formatAbsolute(clock.startsMs, event.startPrecision === "exact")}
</Field>
<Field label="Ends">
{event.endsAt === null ? (
{clock.endsMs === null ? (
<span className="text-faint">Not announced</span>
) : (
formatAbsolute(event.endsAt, event.endPrecision === "exact")
formatAbsolute(clock.endsMs, event.endPrecision === "exact")
)}
</Field>
<Field label="Remaining">
@@ -267,8 +274,10 @@ export function EventDetail({
{event.endPrecision === "day" && event.endsAt !== null && (
<p className="mt-3 text-xs leading-relaxed text-faint">
The source gave a date but no time of day, so this end is accurate to
the day only. Check in-game before the last hours.
The source gave a date but no time of day, so this counts down to
that day's {REGION_LABEL[region]} server reset where these usually land, but a
reading rather than a stated time. Check in-game before the last
hours.
</p>
)}