Skip to content

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

Merged
wanasit merged 1 commit intowanasit:masterfrom
VergilYotov:master
Apr 19, 2026
Merged

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

Conversation

@VergilYotov
Copy link
Copy Markdown
Contributor

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

@wanasit
Copy link
Copy Markdown
Owner

wanasit commented Apr 19, 2026

Sorry for my slow reply. Thank you for investigating and fixing this.

@wanasit wanasit merged commit 66297cc into wanasit:master Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants