fix(isISO8601): reject week-zero dates (W00 is never a valid ISO 8601 week)#2774
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2774 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 114 114
Lines 2587 2587
Branches 656 656
=========================================
Hits 2587 2587 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
WikiRik
approved these changes
Jun 17, 2026
rubiin
approved these changes
Jun 17, 2026
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.
Bug
isISO8601acceptsW00week dates as valid ISO 8601, but ISO 8601 week dates always start at W01 — week zero does not exist.Reference: ISO 8601 § Week date — "The first week of the year contains the first Thursday of the year" and is numbered W01; W00 is never assigned.
Fix
In both
iso8601andiso8601StrictSeparatorregexes, change the week-number alternation from:to:
Verification
All 318 existing tests pass. Four new invalid-case tests added:
'2009-W00','2009-W00-1','2024-W00','2020-W00-7'.Checklist