Skip to content
Toolkit

ADR-0149 — A wall clock the zone skips is moved forward, out loud

Status: Accepted · Date: 2026-08-31 · Track: 002 close-out (LEDGER drain) · Supersedes: nothing · Builds on: ADR-0040, ADR-0139

Context

DateTimePicker composes its value from two controls: the grid picks a day, the time field picks a wall clock, and commit() builds the instant they name with new Date(y, m, d, hh, mm).

On a spring-forward day the local clock skips an hour, so a wall clock inside the gap names no instant at all — 02:30 on 8 March 2026 does not happen in America/New_York. The constructor still answers. Per the specification it resolves the gap with the offset in force before the transition, which lands the result one hour later: 03:30.

That answer is not the defect. The defect is what happened next. The picker is controlled, so the emitted instant comes back as value, the re-sync effect runs setTime(timeOf(selected)), and the field the user typed 02:30 into now reads 03:30 — with nothing anywhere saying so. The trigger then shows an instant nobody chose. ADR-0040 recorded addDays/addMonths/startOfDay as DST-safe because they are local-midnight arithmetic that re-reads the day parts; commit() was the one place that composed a time and the one hole left.

Two answers were available:

  1. Refuse the input — hold the commit while the clock is in the gap.
  2. Substitute and say so — keep the instant, state the substitution.

Decision

The forward-shifted instant is kept, and the substitution is stated in a polite role="status" note inside the panel.

  • Forward, not refused. It is the nearest instant that exists, it stays on the day the user actually chose, and it is what Temporal's default disambiguation (compatible) does for a gap. Refusing leaves a control with no value for a legitimate day, and leaves the user with no way to say "the morning of the 8th" at all.
  • Detection is the round trip, not a table. Build the instant, read its local clock back, and a clock that comes back different is one the zone does not have. No tzdata is shipped, nothing is hardcoded about which Sunday in March any jurisdiction moves, and a zone whose gap is thirty minutes or whose transition is at midnight is detected by the same three lines.
  • Fall-back days are deliberately not detected. An ambiguous 01:30 on an autumn day occurs twice, Date takes the earlier, and the wall clock round-trips unchanged. Nothing is substituted, so there is nothing to say; announcing it would be a lecture about zones rather than a report about the user's own input.
  • The note is drawn as well as spoken, unlike ADR-0139's region. There the message was already on screen and only the announcement was missing. Here nothing was on screen at all, and the sighted user staring at a rewritten field is the one with the question.
  • It is mounted empty and filled later — ADR-0139's rule, for ADR-0139's reason — and it sits in the panel rather than the root, because a commit can only happen while the panel is open and the field it explains is in there. The spacing hangs off :not(:empty) rather than off the element, so the silent state costs no height without display: none taking the region out of the accessibility tree.
  • The note clears when the panel closes, on shown rather than inside close(): the trigger's toggle and the disabled flag both shut the panel without going through it, and a panel reopened must not redraw a substitution already read.

The string is a function of the two clocks (timeShifted(asked, used)), per ADR-0086: an English sentence with two times in it has a word order, and a component that concatenates one has compiled it in.

Consequences

  • The suite runs at UTC, which has no transition, so the block asserting this sets America/New_York itself and opens with a test that the gap is still in tzdata — otherwise every assertion after it would quietly go vacuous. It holds identically under web:test:unit:tz's second zone.
  • min/max on this picker (LEDGER) inherits the rule: a bound is a wall clock too, and comparing one against an instant composed from a gap is the same arithmetic.
  • Nothing else in the tree composes a wall clock into an instant. The seven native datetime-local inputs the LEDGER records have the same hazard and no note; that is an argument for the consistency sweep already recorded, not a second implementation.

Source: docs/decisions/0149-a-wall-clock-the-zone-skips-is-moved-forward-out-loud.md

Library