You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into this issue because the calendar app on newer iPads, probably mistakingly, allows the creation of an event where the start date is not covered by the RRULE. It's possible to create a recurring event that eg. starts on a Wednesday, but has a weekly recurrence rule of only Thursdays.
Apple's iCalendar application and Google Calendar both display that oddball first instance, but my application (which uses ical.js) does not.
The RFC5545 section about RRULE doesn't engrave in stone what's supposed to happen, but it does say (as part of the spec for COUNT in an RRULE):
The "DTSTART" property value always counts as the first occurrence.
... So I'm fairly certain that this is a bug in ical.js.
Here's a reduced test case:
consticalJs=require('ical.js');constvevent=newicalJs.Event(newicalJs.Component(icalJs.parse(`BEGIN:VCALENDARCALSCALE:GREGORIANMETHOD:REQUESTVERSION:2.0BEGIN:VEVENTCLASS:PUBLICCREATED:20160920T065356ZDTSTART:20170301T100000DTEND:20170301T110000RRULE:FREQ=WEEKLY;BYDAY=THSUMMARY:Happens every Thursday, but starts on a WednesdayUID:C2366E0E-09A4-4B9C-B9F5-EE96CEE467F0END:VEVENTEND:VCALENDAR`)).getFirstSubcomponent('vevent'));constiterator=vevent.iterator();letnext;letnum=0;while((next=iterator.next())&&num++<5){console.log(vevent.getOccurrenceDetails(next).startDate.toICALString());}
rrule has the same approach as ical.js, as well as python-dateutil.
From rrule:
Unlike documented in the RFC, the starting datetime, dtstart, is not the first recurrence instance, unless it does fit in the specified rules. This is in part due to this project being a port of python-dateutil, which has the same non-compliant functionality. Note that you can get the original behavior by using a RRuleSet and adding the dtstart as an rdate.
Well the question is whether it is the responsibility of the recurrence iterator to add it, or if it's the responsibility of the developer using the library instead.
I ran into this issue because the calendar app on newer iPads, probably mistakingly, allows the creation of an event where the start date is not covered by the
RRULE
. It's possible to create a recurring event that eg. starts on a Wednesday, but has a weekly recurrence rule of only Thursdays.Apple's iCalendar application and Google Calendar both display that oddball first instance, but my application (which uses ical.js) does not.
The RFC5545 section about RRULE doesn't engrave in stone what's supposed to happen, but it does say (as part of the spec for
COUNT
in anRRULE
):... So I'm fairly certain that this is a bug in ical.js.
Here's a reduced test case:
Output:
Expected output:
The text was updated successfully, but these errors were encountered: