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.28k stars 510 forks source link

rrulestr don't get dtstart from différents rrules #458

Open ArnaudBan opened 3 years ago

ArnaudBan commented 3 years ago

I have a rruleSet that i save as a string in my database that look likes that :

DTSTART;TZID=Europe/Paris:20200909T075600
RRULE:FREQ=WEEKLY;BYDAY=TU;BYHOUR=11;BYMINUTE=15
DTSTART;TZID=Europe/Paris:20200907T075600
RRULE:FREQ=WEEKLY;BYDAY=TH;BYHOUR=11;BYMINUTE=15
DTSTART;TZID=Europe/Paris:20200901T075600
RRULE:FREQ=WEEKLY;BYDAY=WE;BYHOUR=9;BYMINUTE=20;UNTIL=20210415T072000

I try to get each of the rrules so a user can edit them. The probleme is i can't get the different dtstart from each rrules. Every rrules have the same drstart, witch is not the case in my database.

You can test my issue by doing the following :

const databaseRruleSetString = "DTSTART;TZID=Europe/Paris:20200909T075600
RRULE:FREQ=WEEKLY;BYDAY=TU;BYHOUR=11;BYMINUTE=15
DTSTART;TZID=Europe/Paris:20200907T075600
RRULE:FREQ=WEEKLY;BYDAY=TH;BYHOUR=11;BYMINUTE=15
DTSTART;TZID=Europe/Paris:20200901T075600
RRULE:FREQ=WEEKLY;BYDAY=WE;BYHOUR=9;BYMINUTE=20;UNTIL=20210415T072000"

const rruleSet = rrulestr(databaseRruleSetString)
const rruleSetString = rruleSet.toString()

rruleSetString is not the same as databaseRruleSetString every rrules has the same dtstart :

DTSTART;TZID=Europe/Paris:20200909T075600
RRULE:FREQ=WEEKLY;BYDAY=TU;BYHOUR=11;BYMINUTE=15
DTSTART;TZID=Europe/Paris:20200909T075600
RRULE:FREQ=WEEKLY;BYDAY=TH;BYHOUR=11;BYMINUTE=15
DTSTART;TZID=Europe/Paris:20200909T075600
RRULE:FREQ=WEEKLY;BYDAY=WE;BYHOUR=9;BYMINUTE=20;UNTIL=20210415T072000

I am using rrule version 2.6.8

Reporting an issue

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

ephys commented 3 years ago

I think your issue is the same as this one: https://github.com/jakubroztocil/rrule/issues/332