ical-org / ical.net

ical.NET - an open source iCal library for .NET
MIT License
784 stars 231 forks source link

.GetOccurrences() only looking at first RecurrenceRules #559

Closed stephenhendry closed 2 days ago

stephenhendry commented 2 years ago

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?

Wazmin commented 1 year ago

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 :)

gortok commented 7 months ago

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.