jkbrzt / rrule

JavaScript library for working with recurrence rules for calendar dates as defined in the iCalendar RFC and more.
https://jkbrzt.github.io/rrule
Other
3.3k stars 513 forks source link

Bugfix - Apply dtstart option when forceset: true #431

Open jutaz opened 3 years ago

jutaz commented 3 years ago

This PR fixes a bug which happens when using rrulestr in a similar way to this:

rrulestr('RRULE:FREQ=WEEKLY', {
  forceset: true,
  dtstart: new Date()
});

In the past (talking ~2.2.0 ish) this would apply dtstart and the created rules would have the dtstart. That's no longer the behavior. Having an explicit dtstart which could even override the DTSTART: specified in the rule was quite convenient, and this PR brings it back.

What's interesting is that this is already the behavior when one doesn't specify forceset: true.


Thanks for contributing to rrule!

To submit a pull request, please verify that you have done the following:

jbuck94 commented 1 year ago

@jakubroztocil please merge this PR. This bug is blocking my ability to use the library