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.34k stars 513 forks source link

Slow when DTSTART is far apart #392

Open beeing opened 4 years ago

beeing commented 4 years ago

The time taken to generate the dates become slower when the DTSTART is older or further apart.

const s1 = `DTSTART:20180402T064000\nRRULE:FREQ=MINUTELY;INTERVAL=1;BYSECOND=0`
const s2 = `DTSTART:20200402T064000\nRRULE:FREQ=MINUTELY;INTERVAL=1;BYSECOND=0`

const start = new Date('4/2/2020 2:40:00 PM')
const end  = new Date('4/2/2020 2:50:00 PM')

const rRule = RRule.fromString(s1)   // try using s2
const dates = rRule.between(start, end) // time taken varies between s1 and s2

console.log(dates)

tested on: