Commit Graph
7 Commits
Author SHA1 Message Date
upstream c0f903d615 Upstream olebedev/when state of the touched files before 6564437490 2026-10-03 02:49:55 +02:00
dualfroz c2384ff7ad feat(rules): add the aggressive deadline option to nl and br 2026-10-03 01:52:53 +02:00
upstream b80ddbf523 Upstream olebedev/when state of the touched files before c678d86b1e 2026-10-03 01:52:53 +02:00
dualfroz 52f50c7639 feat(rules): make in/within optional in the en deadline rule 2026-10-02 16:04:11 +02:00
upstream 751720c04d Upstream olebedev/when state of the touched files before 8381199380 2026-10-02 16:04:11 +02:00
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
upstream d6f26b54a6 Upstream olebedev/when state of the touched files before 978901adc2 2026-09-27 12:38:39 +02:00