Skip to content

fix(en): keep the year in dates like 'March 15, 2025' - #61

Open
jayhemnani9910 wants to merge 1 commit into
olebedev:masterfrom
jayhemnani9910:fix/month-date-year
Open

jayhemnani9910 wants to merge 1 commit into
olebedev:masterfrom
jayhemnani9910:fix/month-date-year

Conversation

@jayhemnani9910

Copy link
Copy Markdown

With a reference date in 2024, March 15, 2025 returns 2024-03-15, and 15 March 2025 returns nil because 2025 is parsed as the day.

ExactMonthDate now takes an optional 4-digit year after the day or month. Dates without a year are unchanged.

Added a test, it fails without the change. go test ./... passes.

The year was dropped, so the date landed in the reference year, and
'15 March 2025' failed to parse at all.
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.

1 participant