Repository navigation
Conversation
Author
|
Hi @wanasit, could you take a look at this when you have a chance? Happy to make changes if anything needs work. Thanks! |
This branch has not been deployed
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.
Implements #638.
Bare four-digit numbers are intentionally not parsed as times (years - see the guard added for "2019 to 2020"), so this adds a dedicated
ENMilitaryTimeParserfor the shapes that unambiguously mark a four-digit group as a time of day:1430 hours,0930hrs,0800 hr("hours" suffix)at 1430,meet at 0930("at" prefix)1430Z,1430 Z(Zulu designator - also assignstimezoneOffset0)The HHMM value is validated (hour 00-23, minute 00-59), so invalid times like
at 2460orat 2500 hoursare rejected, and bare numbers (1430,2019 to 2020) still do not parse. The parser is a small standalone parser per the repo's modular-parser guidance, registered in the EN configuration right afterENTimeExpressionParser, and merges with dates as usual ("On Oct 22 at 1430 hours", "at 0745 tomorrow").Tests: new
test/en/en_military_time.test.ts(individually spelled-out cases per AGENTS.md: suffix/prefix/Zulu forms, date merging, bare-number negatives, invalid-time negatives). Full suite: 159 suites / 759 tests pass;npm run prettierapplied.