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.27k stars 507 forks source link

between returns no dates if second parameter is after rule's end date #530

Closed Rhysjc closed 2 years ago

Rhysjc commented 2 years ago

Reporting an issue

If you create a rule with an end date, then call between(new Date(), some date after the end date), you get back an empty array

Example

const rule = new RRule({
  dstart: new Date('2022-07-08T00:00:00.000Z'),
  until: new Date('2022-08-25T00:00:00.000Z'),
  freq: RRule.WEEKLY,
  interval: 1,
  byweekday: [0, 4],
});

console.log(rule.between(new Date(), new Date('2022-08-24T00:00:00.000Z'))) // Array of dates
console.log(rule.between(new Date(), new Date('2022-08-26T00:00:00.000Z'))) // Expect an array of dates but get empty array

Version: 2.6.4 (Latest version has bugs with timezones) Timezone: BST

Thank you for taking an interest in rrule! Please include the following in your report: