2

I am using rrulestr from the rrule.js library to parse a set of rrule strings.

I want to set the dtstart using the RRuleStrOptions and tried the following.

const rrule = rrulestr(
   "RRULE:INTERVAL=1;FREQ=DAILY;COUNT=5",
   { dtstart: new Date("2021-08-01T10:00:00+00:00") }
);

This worked perfectly. (Below is the output of rrule.toString())

DTSTART:20210801T100000Z
RRULE:INTERVAL=1;FREQ=DAILY;COUNT=5

But when I added exdate to the rrule string, the dtstart option was not applied.

const rrule = rrulestr(
  "RRULE:INTERVAL=1;FREQ=DAILY;COUNT=5\\nEXDATE:20210802T100000Z",
  { dtstart: new Date("2021-08-01T10:00:00+00:00") }
)

Below is the output of rrule.toString()

RRULE:INTERVAL=1;FREQ=DAILY;COUNT=5
EXDATE:20210802T100000Z

Please help me fix this issue. Thank you for your generous support.

0 Answers0