Fix meridiem merge for casual times and add -5d midnight regression#637
Open
VergilYotov wants to merge 1 commit intowanasit:masterfrom
Open
Fix meridiem merge for casual times and add -5d midnight regression#637VergilYotov wants to merge 1 commit intowanasit:masterfrom
VergilYotov wants to merge 1 commit intowanasit:masterfrom
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.
Original bug: When merging a relative date (-5d) with a time-only expression (00), the date component’s implied meridiem (PM) could override the time parser’s implied AM, shifting midnight to noon. This also
caused casual phrases like “tonight at 8” to lose their PM context in other locales. Example -5d 00 was resolving to 5 days ago at 12:00:00 (noon).
Fix: Meridiem is now only overridden by the time side when the date side lacks a meaningful meridiem (certain or tagged casual reference). Casual time parsers for es/pt/nl now emit casualReference/* tags so
their implied PM/AM is respected.
New test: Added a regression case for "-5d 00" to ensure it resolves to Sep 26, 2016 00:00 from an Oct 1, 2016 noon reference.
Please review the merge heuristic; if you’d like a different “meaningful meridiem” rule (e.g., stricter tags or locale-specific treatment), I can adjust.