Repository navigation
Conversation
…year "May 32, 2021" was rejected by ENMonthNameMiddleEndianParser (day > 31), but ENMonthNameParser then matched "May 32" as month + two-digit year and returned 2032-05-01, dropping the explicit ", 2021". Skip the two-digit year in ENMonthNameParser when it is followed by a comma and a four-digit year. Fixes wanasit#677
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.
Fixes #677.
ENMonthNameMiddleEndianParseralready rejectsMay 32, 2021because the day is over 31, butENMonthNameParserthen picks upMay 32on its own, reads32as a two-digit year and returns 2032-05-01. The explicit, 2021is dropped.ENMonthNameParsernow skips a two-digit year when it is directly followed by a comma and a four-digit year. PlainMay 99/Aug 9 96style inputs are unchanged.32 May 2021from the issue still givesMay 2021(the stray number is just not part of the match). I left that alone since it doesn't invent a wrong year, happy to tighten it too if you'd prefer.Added casual-mode cases next to the existing strict-mode impossible-date tests.
npm testpasses.