ical.net icon indicating copy to clipboard operation
ical.net copied to clipboard

.GetOccurrences() only looking at first RecurrenceRules

Open stephenhendry opened this issue 3 years ago • 2 comments

I have the following coming from my ical feed:

BEGIN:VEVENT
DTSTART;TZID=Europe/London:20220101T180000
DTEND;TZID=Europe/London:20220101T230000
RRULE:FREQ=YEARLY;COUNT=3;INTERVAL=1;BYMONTH=10;BYDAY=1WE
RRULE:FREQ=YEARLY;COUNT=3;INTERVAL=1;BYMONTH=11;BYDAY=1WE
RRULE:FREQ=YEARLY;COUNT=3;INTERVAL=1;BYMONTH=1;BYDAY=1WE
RRULE:FREQ=YEARLY;COUNT=3;INTERVAL=1;BYMONTH=2;BYDAY=1WE
RRULE:FREQ=YEARLY;COUNT=3;INTERVAL=1;BYMONTH=3;BYDAY=1WE
RRULE:FREQ=YEARLY;COUNT=3;INTERVAL=1;BYMONTH=4;BYDAY=1WE
RRULE:FREQ=YEARLY;COUNT=3;INTERVAL=1;BYMONTH=5;BYDAY=1WE
RRULE:FREQ=YEARLY;COUNT=3;INTERVAL=1;BYMONTH=6;BYDAY=1WE
DTSTAMP:20221011T095103Z
UID:Ical4fa23491908fccd532b32da26bac4662
CREATED:19000101T120000Z
DESCRIPTION:this is a test
LAST-MODIFIED:20221003T191319Z
LOCATION:London
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY: test
TRANSP:OPAQUE
END:VEVENT

When I call .GetOccurrences(start date, end date) it is only returning the first RRULE occurrences and not the others. Is it possible to look at all the rules?

stephenhendry avatar Oct 11 '22 13:10 stephenhendry

Hello stephenhendry,

in the RFC 5545 the section about RRULE (https://www.rfc-editor.org/rfc/rfc5545#section-3.8.5.3) says that RRULE can only be defined once. So in the ical.net I thing it only consider the first one, I did not wen into the code but that does not matter since the best way is to follow the rfc first :)

It's a late answer but could be useful for other.

To me it's "not a defect" case :)

Wazmin avatar Dec 15 '22 14:12 Wazmin

it may not be a defect; but the specification doesn't disallow it (just says the behavior is undefined):

but it SHOULD NOT be specified more than once. The recurrence set generated with multiple "RRULE" properties is undefined.

gortok avatar Mar 16 '24 00:03 gortok