Recurrence: unsorted BYMONTHDAY returns non-earliest date; YEARLY ignores all but first #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
MONTHLY
next_occurrence(src/core/recurrence.rs:245-251) iteratesby_month_dayin the order given and returns the first candidate> after, not the minimum. With an unsorted list (e.g.BYMONTHDAY=15,1) it can return a later day than the earliest valid one.The YEARLY branch (lines 273-277) is worse: it only ever uses
by_month_day[0], ignoring any additional values.Fix: sort
by_month_dayascending (and scan months/years in order, picking the minimum valid candidate> after); handle multiple BYMONTHDAY values in the YEARLY branch too. Add tests with multi-value and unsorted BYMONTHDAY for both MONTHLY and YEARLY.Found in review.