Skip to content

Fix meridiem merge for casual times and add -5d midnight regression#637

Open
VergilYotov wants to merge 1 commit intowanasit:masterfrom
VergilYotov:master
Open

Fix meridiem merge for casual times and add -5d midnight regression#637
VergilYotov wants to merge 1 commit intowanasit:masterfrom
VergilYotov:master

Conversation

@VergilYotov
Copy link
Copy Markdown

  • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant