Repository navigation
fix(rules/en): parse 12 am as midnight - #55
Merged
Merged
Conversation
olebedev
approved these changes
Oct 14, 2026
olebedev
left a comment
Owner
There was a problem hiding this comment.
Reviewed the midnight conversion in both English time rules. Tests and go vet pass on the PR combined with current master (Go 1.26.7).
This was referenced Oct 14, 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 English
HourandHourMinuterules treat12 amas noon:The same happens for
12am,12 A.M.and12:00 am tomorrow. The pm branch already leaves 12 as is and adds 12 to the other hours; the am branch used the hour as written, so 12 stayed 12. This maps 12 am to hour 0 in both rules.Testing:
hour_test.go(at 12 am,12A.M.) andhour_minute_test.go(12:30am,at 12:00 am, plus12:30pmto pin the pm side) fail before the change and pass after.go test ./...andgo vet ./...pass.The
brandruhour rules have the same am branch; I left them out because I can't confirm how 12 is written with those markers in those languages.