Add ISO week validation with inclusive bounds - #121
Merged
Merged
Conversation
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.
Adds ISO week validation for values such as
2020-W53, rejecting nonexistent weeks such as2021-W53.it.IsWeek().WithMin("2020-W01").WithMax("2021-W01")supports inclusive ranges across ISO years;validate.Weekandis.Weekexpose standalone validation with matching options.YYYY-Wwwformat, calendar-aware week 53 validation, and separate format, week-number, minimum, and maximum violations.This/Each, and English/Russian translations.mktimerules.Validation:
bash scripts/test-all.sh(formatting, vet, golangci-lint v2.13.2, unit tests, race tests, module tidy and verification). Tests cover strict parsing, cross-year bounds, all four violations, custom messages, translations, and week 53 for every year 0000–9999 against the independent January 1/leap-year rule.Closes #108.