Skip to content

Honor UTC mode for ISO week and weekday tokens - #188

Merged
chase-manning merged 1 commit into
felixge:masterfrom
xiehuanyi:fix/utc-iso-week-tokens
Oct 11, 2026
Merged

chase-manning merged 1 commit into
felixge:masterfrom
xiehuanyi:fix/utc-iso-week-tokens

Conversation

@xiehuanyi

Copy link
Copy Markdown
Contributor

In America/Los_Angeles, formatting 2022-01-03T00:30:00Z with UTC:yyyy-mm-dd WW N returns 2022-01-03 52 7: the calendar date is Monday in UTC, but the week and weekday still come from the preceding local Sunday. The inverse occurs in Tokyo near the end of a UTC Sunday.

Pass UTC mode to the ISO week and weekday helpers. Derive the week from the selected calendar date using UTC date arithmetic, so the calculation does not mix time zones or daylight-saving offsets. UTC:, GMT:, and the explicit UTC argument now agree with the other date tokens. Local formatting uses the local calendar day.

Validation: both new cross-timezone regressions fail on unchanged master. TZ=UTC npm test passes all151 tests, including the Babel/minification build. The new tests use isolated Los Angeles and Tokyo processes and check all three UTC entry points plus local-mode controls. git diff --check passes. Tested on Node22.23.1; the Node12.20 minimum and browser execution were not exercised. Generated distributions are excluded from the change.

AI disclosure: OpenAI Codex assisted with investigation, implementation, regression tests, and this description.

AI-assisted implementation and verification using OpenAI Codex.
Copilot AI balanced review requested due to automatic review settings October 10, 2026 17:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chase-manning
chase-manning merged commit 88baec4 into felixge:master Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants