Repository navigation
Honor UTC mode for ISO week and weekday tokens - #188
Merged
Merged
Conversation
AI-assisted implementation and verification using OpenAI Codex.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
America/Los_Angeles, formatting2022-01-03T00:30:00ZwithUTC:yyyy-mm-dd WW Nreturns2022-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 testpasses 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 --checkpasses. 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.