RRULE to generate a given number of days with exclude dates

47 views Asked by At

I want to generate for example 5 days with rrules and exclude a given days or a series of days. But if the codes like below:

const rruleSet = new RRuleSet();
rruleSet.rrule(
  new RRule({
    freq: RRule.DAILY,
    count: 5,
    dtstart: new Date("Aug 2020 10 10:30 am"),
  })
);

rruleSet.exdate(new Date("Aug 2020 12 10:30 am"));

It gives me 10, 11, 13, 14 Aug. But I want 10, 11, 13, 14, 15, which means that I want to generate enough days which equal to count, after applying the exdate. Is there any way to achieve that? Many thanks!

0

There are 0 answers