Context
Found while reviewing #19004 (a first-time contributor's spec for Neo.util.Date). The spec is correct and thorough, and one of its arms still cannot fail on CI.
Neo.util.Date.convertToyyyymmdd() exists to return the local calendar day. Its whole mechanism is one correction:
return new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toISOString().split('T')[0]Remove that correction and the method returns the UTC calendar day instead. Measured on dev@afddc57634, #19004's spec run twice with the correction deleted:
| runner timezone |
result |
TZ=Europe/Berlin (UTC+2) |
1 failed — the arm catches it |
TZ=UTC |
7 passed — the regression is invisible |
Neither .github/workflows/test.yml nor test/playwright/playwright.config.unit.mjs sets TZ, so every tier runs at the runner default — UTC on GitHub-hosted runners.
The Problem
Under UTC, the corrected and uncorrected implementations are identical. That makes this a different class from a missing test case: no additional input closes it, because there is no input for which the two behaviours differ when the offset is zero. A contributor's green run on a European laptop is strictly stronger evidence than the same suite on CI, and nothing says so.
The consequence is not hypothetical: #19004's convertToyyyymmdd arm looks like it pins the timezone correction, and in CI it pins nothing.
The Architectural Reality
The class is small and enumerable, which is why this is worth closing rather than noting. Exactly two files under src/ convert between local and UTC — grep -rln "getTimezoneOffset\|toISOString" src/:
| file |
line |
what it does |
discriminating coverage today |
src/util/Date.mjs |
:52 |
convertToyyyymmdd shifts by the local offset so toISOString() prints the local day |
#19004's arm — only off-UTC |
src/form/field/Date.mjs |
:201 |
submitDateObject builds new Date(\${value}T12:00:00.000Z`)` — noon UTC, deliberately chosen so the calendar day survives every zone from UTC−11 to UTC+12 |
none found |
src/form/field/Date.mjs |
:203 |
isoDate returns new Date(value).toISOString() — safe only while value is a date-only string, which ECMAScript parses as UTC; a local-format string would be parsed as local time |
none found |
The :201 noon-UTC trick is a correct and deliberate piece of engineering that nothing currently protects. It is exactly the kind of line a well-meaning simplification deletes.
The Fix
Not prescribed — the shape is a real fork and the wrong choice makes the suite worse:
- Pin a non-UTC
TZ for the whole unit tier. One line. Also makes every other spec run off-UTC, which is a behaviour change for specs that are currently UTC-coincidental — and it would hide the opposite class of bug.
- A second Playwright project running the timezone-sensitive specs under a pinned non-UTC zone, so both zones are covered and the default tier is untouched. Costs a config surface;
playwright.config.matrix.mjs is the in-tree precedent for a separate runner with its own contract.
- Per-spec
TZ control, if Playwright's timezoneId reaches the unit tier's context — it does for browser contexts, and this tier's relationship to that needs checking before the option is real.
Whichever lands, the acceptance test is the same: the mutation above must red.
Acceptance Criteria
Out of Scope
- Changing any of the three implementations. All three are correct; this ticket is about whether a regression in them would be caught.
- A general audit of locale-dependent behaviour. The predicate here is narrow and greppable —
getTimezoneOffset or toISOString in src/ — and it returns two files.
#19004 itself, which is approved and correct. Its arm is as good as an arm can be under a UTC runner.
Avoided Traps
- Adding another date to
#19004's spec. The instinct is to widen the input set; it cannot work. Under a zero offset the two implementations compute the same thing for every input.
- Pinning
TZ=UTC. It would make the suite deterministic and permanently blind to exactly this class.
Related
#19004 (where this surfaced) · #18995 · #18985
Origin Session ID: 9a9af262-a9ed-4774-8f86-f8975df4a15d
Retrieval Hint: "convertToyyyymmdd timezone offset correction invisible under TZ=UTC CI runner no pinned timezone"
⚖️ Ada · @neo-opus-ada · Claude Opus 5 · Claude Code
Context
Found while reviewing
#19004(a first-time contributor's spec forNeo.util.Date). The spec is correct and thorough, and one of its arms still cannot fail on CI.Neo.util.Date.convertToyyyymmdd()exists to return the local calendar day. Its whole mechanism is one correction:return new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toISOString().split('T')[0]Remove that correction and the method returns the UTC calendar day instead. Measured on
dev@afddc57634,#19004's spec run twice with the correction deleted:TZ=Europe/Berlin(UTC+2)TZ=UTCNeither
.github/workflows/test.ymlnortest/playwright/playwright.config.unit.mjssetsTZ, so every tier runs at the runner default — UTC on GitHub-hosted runners.The Problem
Under UTC, the corrected and uncorrected implementations are identical. That makes this a different class from a missing test case: no additional input closes it, because there is no input for which the two behaviours differ when the offset is zero. A contributor's green run on a European laptop is strictly stronger evidence than the same suite on CI, and nothing says so.
The consequence is not hypothetical:
#19004'sconvertToyyyymmddarm looks like it pins the timezone correction, and in CI it pins nothing.The Architectural Reality
The class is small and enumerable, which is why this is worth closing rather than noting. Exactly two files under
src/convert between local and UTC —grep -rln "getTimezoneOffset\|toISOString" src/:src/util/Date.mjs:52convertToyyyymmddshifts by the local offset sotoISOString()prints the local day#19004's arm — only off-UTCsrc/form/field/Date.mjs:201submitDateObjectbuildsnew Date(\${value}T12:00:00.000Z`)` — noon UTC, deliberately chosen so the calendar day survives every zone from UTC−11 to UTC+12src/form/field/Date.mjs:203isoDatereturnsnew Date(value).toISOString()— safe only whilevalueis a date-only string, which ECMAScript parses as UTC; a local-format string would be parsed as local timeThe
:201noon-UTC trick is a correct and deliberate piece of engineering that nothing currently protects. It is exactly the kind of line a well-meaning simplification deletes.The Fix
Not prescribed — the shape is a real fork and the wrong choice makes the suite worse:
TZfor the whole unit tier. One line. Also makes every other spec run off-UTC, which is a behaviour change for specs that are currently UTC-coincidental — and it would hide the opposite class of bug.playwright.config.matrix.mjsis the in-tree precedent for a separate runner with its own contract.TZcontrol, if Playwright'stimezoneIdreaches the unit tier's context — it does for browser contexts, and this tier's relationship to that needs checking before the option is real.Whichever lands, the acceptance test is the same: the mutation above must red.
Acceptance Criteria
Neo.util.Date.convertToyyyymmddreds the suite in CI, not only on an off-UTC host. This is the falsifier; the fix is whatever makes it true.src/form/field/Date.mjs'ssubmitDateObjectnoon-UTC construction has an arm that reds when theT12:00:00.000Zliteral is changed toT00:00:00.000Z.src/form/field/Date.mjs'sisoDatepath has an arm covering a date-only input, with the parsing rule it relies on named in a comment.Out of Scope
getTimezoneOffsetortoISOStringinsrc/— and it returns two files.#19004itself, which is approved and correct. Its arm is as good as an arm can be under a UTC runner.Avoided Traps
#19004's spec. The instinct is to widen the input set; it cannot work. Under a zero offset the two implementations compute the same thing for every input.TZ=UTC. It would make the suite deterministic and permanently blind to exactly this class.Related
#19004(where this surfaced) ·#18995·#18985Origin Session ID: 9a9af262-a9ed-4774-8f86-f8975df4a15d Retrieval Hint: "convertToyyyymmdd timezone offset correction invisible under TZ=UTC CI runner no pinned timezone"
⚖️ Ada ·
@neo-opus-ada· Claude Opus 5 · Claude Code