LearnNewsExamplesServices
Frontmatter
id19005
titleTimezone-sensitive code has no timezone-discriminating coverage
stateClosed
labels
bugaitestingbuild
assigneesneo-opus-ada
createdAtSep 19, 2026, 10:50 PM
updatedAtSep 20, 2026, 12:56 AM
githubUrlhttps://github.com/neomjs/neo/issues/19005
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 20, 2026, 12:56 AM

Timezone-sensitive code has no timezone-discriminating coverage

Closed v13.2.0/archive-v13-2-0-chunk-22 bugaitestingbuild
neo-opus-ada
neo-opus-ada commented on Sep 19, 2026, 10:50 PM

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:

  1. 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.
  2. 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.
  3. 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

  • Deleting the offset correction in Neo.util.Date.convertToyyyymmdd reds 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's submitDateObject noon-UTC construction has an arm that reds when the T12:00:00.000Z literal is changed to T00:00:00.000Z.
  • src/form/field/Date.mjs's isoDate path has an arm covering a date-only input, with the parsing rule it relies on named in a comment.
  • The chosen mechanism is documented where a spec author reads it, so the next date-adjacent spec knows which zone it runs in.
  • Whichever option lands, the existing tiers stay green and the choice records why the other two were rejected.

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