Reputation: 1850
I have a script that generates ics files and some events tend to have complex recurrence rules (i.e. every Monday between date1 and date2 except on holiday1 or holiday2 but also occurs once on randomDate1)
Given my understanding of the spec defined here, it seems pretty straightforward to represent this as a mix between RRULE, RDATE and EXDATE
As you can see below in My Complex Event
However, once i open this file in MS Outlook 2016, i see the event on the dates targeted by RRULE, i don't see it on the one targeted by EXDATE (which is okay) but i don't see it on the date targeted by RDATE (not okay)
I have validated my ical here and found no errors. So i'm wondering: Is this an Outlook bug? Is there some order i should use for the ical properties?
I also tried importing this into Google Calendar, but instead of seeing the occurrence defined on Wednesday April 13 i saw it on Tuesday April 12. The RRULE and EXDATE worked as expected too.
Any ideas?
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//dkhalife//NONSGML Dany v2.0//FR
METHOD:PUBLISH
X-WR-CALNAME:Dany
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:America/Montreal
BEGIN:DAYLIGHT
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
TZNAME:EDT
DTSTART:19700308T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
TZNAME:EST
DTSTART:19701101T020000
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CATEGORIES:Cours
SUMMARY:My Complex Event
LOCATION:Location Location Location
DTSTART;TZID=America/Montreal:20160111T124500
DTEND;TZID=America/Montreal:20160111T143500
RRULE:FREQ=WEEKLY;INTERVAL=1;UNTIL=20160415
RDATE;VALUE=DATE:20160413
EXDATE;VALUE=DATE:20160125
UID:xxxx
END:VEVENT
END:VCALENDAR
Upvotes: 1
Views: 1592
Reputation: 3862
Your event has a time, but the RDATE
and EXDATE
values are all-day, which doesn't make sense (I outlined that few years ago in response to a bug in KOrganizer) and is invalid IMO (even though RFC 5545 doesn't say that explicitly).
Try to replace
RDATE;VALUE=DATE:20160413
EXDATE;VALUE=DATE:20160125
by
RDATE;TZID=America/Montreal:20160413T124500
EXDATE;TZID=America/Montreal:20160125T124500
Btw. the same is true for the UNTIL
clause which MUST be specified in UTC time if your event is anchored in any time zone (this is explicitly specified in RFC 5545).
So your RRULE
should look like:
RRULE:FREQ=WEEKLY;INTERVAL=1;UNTIL=20160415T164500Z
Upvotes: 1