jkbrzt / rrule

JavaScript library for working with recurrence rules for calendar dates as defined in the iCalendar RFC and more.

Home Page:https://jkbrzt.github.io/rrule

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RRule.all() is returning different results if parsed from string or directly evaulated

domicode opened this issue · comments

I am creating a recurring rule in my JavaScript, however the Rule.all() behaves differently if I pass the generated string or call the method directly.
Code snippet:

const rule = new RRule({
    freq,
    dtstart: datetime(from.year(), from.month() + 1, from.date(), from.hour(), from.minute()),
    interval: this.recurringInterval,
    wkst: RRule.MO,
    count: 3,
    byweekday: this.weekdayOption
});
console.log(rule.toString());
console.log(rule.all());
console.log(RRule.fromString(rule.toString()).all());

Output rule string:

DTSTART:20230404T080000Z
RRULE:FREQ=WEEKLY;INTERVAL=1;WKST=MO;COUNT=3

Output rule.all()

0 : Tue Apr 04 2023 10:00:00 GMT+0200 (Central European Summer Time) {}
1 : Wed Apr 05 2023 10:00:00 GMT+0200 (Central European Summer Time) {}
2 : Thu Apr 06 2023 10:00:00 GMT+0200 (Central European Summer Time) {}

Output rule.all() after passing the string

0 : Tue Apr 04 2023 10:00:00 GMT+0200 (Central European Summer Time) {}
1 : Tue Apr 11 2023 10:00:00 GMT+0200 (Central European Summer Time) {}
2 : Tue Apr 18 2023 10:00:00 GMT+0200 (Central European Summer Time) {}
  • Verify that you've looked through existing issues for duplicates before
    creating a new one
  • Code sample reproducing the issue. Be sure to include all input values you
    are using such as the exact RRule string and dates.
  • Expected output
  • Actual output
  • The version of rrule you are using: 2.7.2
  • Your operating system: 11.3.1 macOs BigSur
  • Your local timezone: Tue Apr 4 09:46:47 CEST 2023

May have something to do with this?

#523