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.24k stars 506 forks source link

[bug] Decimal interval creates an infinite loop #602

Open reekoz opened 8 months ago

reekoz commented 8 months ago

Minimal repro script:

const { rrulestr } = require("rrule")
const from = new Date("2023-10-24T08:32:21.533Z")
const to = new Date("2023-11-01T08:32:21.533Z")
const rrule = rrulestr('DTSTART:20231003T040000Z\nRRULE:FREQ=DAILY;INTERVAL=0.5')
const dates = rrule.between(from, to, true)
// This line is never reached
console.log('dates', dates, '\n\n')
robertsLando commented 8 months ago

The same can be reproduced from: http://jkbrzt.github.io/rrule/ by selecting RRULE String in tab and set a decimal interval. The page stops responding

2023-10-24_11-18

davidgoli commented 8 months ago

Decimal intervals aren't supported in this library. Would accept a PR that validates interval format.