Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add exrule after querying rruleset #642

Open
jofmi opened this issue Oct 28, 2024 · 0 comments
Open

Cannot add exrule after querying rruleset #642

jofmi opened this issue Oct 28, 2024 · 0 comments

Comments

@jofmi
Copy link

jofmi commented Oct 28, 2024

If I apply exrule after querying the rruleset, the exrule will not be applied.

Here is an example:

const rruleSet = new RRuleSet();

// Add a rrule to rruleSet
rruleSet.rrule(
  new RRule({
    freq: RRule.MONTHLY,
    count: 5,
    dtstart: datetime(2012, 2, 1, 10, 30),
  }),
);

// Querying the rruleset before applying the exrule
console.log("Before", rruleSet.all());

// Add a exclusion rrule to rruleSet
rruleSet.exrule(
  new RRule({
    freq: RRule.MONTHLY,
    count: 2,
    dtstart: datetime(2012, 3, 1, 10, 30),
  }),
);

// If the ruleset is queried above, this will show 5 dates (exrule not applied)
// If the ruleset is NOT queried above, this will show 3 dates (exrule applied)
console.log("After", rruleSet.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

No branches or pull requests

1 participant