Files
olebedev-when/rules/en
dualfroz d98b8ffe43 fix(rules): keep parsed month from overflowing into the next one (#50)
Context.Time applied the parsed month while the day was still the one of
the reference date. When that day does not exist in the target month,
time.Date normalizes it forward, so "september 5th" parsed on the 31st
of October resolved to the 5th of October. The parsed day was only
applied afterwards, to the already wrong month.

Clamp the reference day to the last day of the target month before
switching the month. The parsed day still overwrites it afterwards, so
the ordering of the branches in Context.Time is unchanged.

The existing fixtures pin the reference date to 2016-01-06 and the 6th
exists in every month, so the overflow never triggered. Add a regression
test that parses against 2016-10-31.

Fixes #12
2026-09-27 20:38:39 +10:00
..