Skip to content

RRule.after, Rule.before ignoring EXDATE when using caching #665

@erikvdplas

Description

@erikvdplas

I came accross this issue with the following (simple) rule set, i.e. a monthly recurrence with one exception for April 1st, 2026:

DTSTART;TZID=Europe/Amsterdam:20260101T163000
RRULE:FREQ=MONTHLY;INTERVAL=1
RDATE;TZID=Europe/Amsterdam:20260327T093000
EXDATE;TZID=Europe/Amsterdam:20260401T163000

When I use set.all() it correctly omits the April date, and includes the 'replacement' March 27, 2026. However, when I check the following, it gives an unexpected result:

const aprilOccurrence = new Date('2026-04-01T16:30:00.000Z')
ruleSet.after(aprilOccurrence, true)
> 2026-04-01T16:30:00.000Z

Similar behavior occurs when using Rule.before or even Rule.between.

This seems like a bug to me, any chance I might be missing something? Would love to help if possible, but first I am curious to hear from regular maintainers here what might be at play and if this is indeed unexpected behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions