Fix isISO8601 rejecting valid ordinal day 360#2787
Merged
rubiin merged 1 commit intoJun 29, 2026
Conversation
The ordinal-date day sub-pattern `3([0-5]\d|6[1-6])` left a one-value gap: day 360 matched neither branch (`[0-5]\d` excludes 6x, `6[1-6]` excludes x0), so valid ISO 8601 ordinal dates such as `2019-360` were rejected. Day 360 exists in every year (all years have >= 365 days). Change `6[1-6]` to `6[0-6]` in both the standard and strict-separator regexes to accept 360-366, and add `2019-360` to the valid fixtures.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2787 +/- ##
=========================================
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 28, 2026
rubiin
approved these changes
Jun 29, 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.
The ordinal-date day sub-pattern
3([0-5]\d|6[1-6])has a one-value gap: day 360 matches neither branch —[0-5]\dexcludes6xand6[1-6]excludesx0— so valid ISO 8601 ordinal dates such as2019-360are rejected.Day 360 exists in every year (all years have ≥ 365 days), so it is always a valid ordinal day. Brute-forcing 300–366 shows 360 is the only rejected value.
isValidDatealready acceptsoDay <= 365/366, so the regex was the sole gate failing.Changed
6[1-6]→6[0-6]in both the standard and strict-separator regexes, and added2019-360to the valid fixtures.