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

TypeError: Cannot read properties of undefined (reading 'n')\n at parseOptions #627

Closed hendurhance closed 3 weeks ago

hendurhance commented 3 weeks ago

Reporting an issue

Rule options by DTO:

const rruleOptions ={
  freq: 2,
  interval: 1,
  dtstart: 2024-06-23T07:00:00.000Z,
  wkst: Weekday { weekday: 7, n: undefined },
  count: 2,
  until: undefined,
  byweekday: [
    Weekday { weekday: 6, n: undefined },
    Weekday { weekday: 0, n: undefined }
  ]
}

Rule options by Existing Booking:

const rruleOptions ={
  freq: 1,
  interval: 1,
  dtstart: 2024-06-24T12:00:00.000Z,
  wkst: Weekday { weekday: 7, n: undefined },
  count: 5,
  until: undefined,
  bymonthday: [ 5 ]
}

I get error: "TypeError: Cannot read properties of undefined (reading 'n')\n at parseOptions .../node_modules/rrule/dist/es5/rrule.js:2091:23)\n at new RRule .../node_modules/rrule/dist/es5/rrule.js:3168:29)\n