Search code examples
iosios8icalendarrfc5545

iCalendar: Recurring events are not correctly displayed in IOS


Brief introduction

Recurring events in my PHP-generated iCalendar file does not recur correctly with IOS applications. They do recur correctly in Outlook 2010 and Google Calendar, but not in IOS 8.1 (iPhone 5S and iPad 2).

Details

The following file generates a calendar file fit for subscription from applications like MS Outlook and Google Calendar. The file contains a VTIMEZONE and a single VEVENT, meant to recur every friday from 7 - 28. nov 2014, four recurrences in total.

iCalendar file: http://www.elitesystemer.no/mycal_stack_example.php (full code below)

On both my iDevices (IOS 8.1) this event occurs only once; 7. nov 2014. This odd behaviour goes for the native calendar app as well as the Week Calendar app (site: http://weekcal.com).

The file works perfectly with MS Outlook 2010 and Google Calendar, but not with IOS. Unfortunately, I have not been able to find any equivalent issue at the Apple forums. Neither am I able to test with an iDevice with a former OS version, nor with another smart phone at the time.

I have tested the file at online iCalendar validators like http://icalvalid.cloudapp.net/ and http://severinghaus.org/projects/icv/ - perfect results without warnings / errors.

Calendar code generated from PHP

<?php
//set correct content-type-header
header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: inline; filename=mycal_stack_example.ics');
?>
BEGIN:VCALENDAR<?echo "\r\n";?>
VERSION:2.0<?echo "\r\n";?>
METHOD:PUBLISH<?echo "\r\n";?>
CALSCALE:GREGORIAN<?echo "\r\n";?>
PRODID:-//Elite Systemer//Ver 1.6//NO<?echo "\r\n";?>
BEGIN:VTIMEZONE<?echo "\r\n";?>
TZID:Europe/Oslo<?echo "\r\n";?>
BEGIN:DAYLIGHT<?echo "\r\n";?>
DTSTART:19810329T020000<?echo "\r\n";?>
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU<?echo "\r\n";?>
TZNAME:CEST<?echo "\r\n";?>
TZOFFSETFROM:+0100<?echo "\r\n";?>
TZOFFSETTO:+0200<?echo "\r\n";?>
END:DAYLIGHT<?echo "\r\n";?>
BEGIN:STANDARD<?echo "\r\n";?>
DTSTART:19961027T030000<?echo "\r\n";?>
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU<?echo "\r\n";?>
TZNAME:CET<?echo "\r\n";?>
TZOFFSETFROM:+0200<?echo "\r\n";?>
TZOFFSETTO:+0100<?echo "\r\n";?>
END:STANDARD<?echo "\r\n";?>
END:VTIMEZONE<?echo "\r\n";?>
BEGIN:VEVENT<?echo "\r\n";?>
UID:[email protected]<?echo "\r\n";?>
DTSTART;TZID=Europe/Oslo:20141107T140000<?echo "\r\n";?>
DURATION:PT60M<?echo "\r\n";?>
RRULE:WKST=MO;FREQ=WEEKLY;INTERVAL=1;BYDAY=FR;UNTIL=20141128T150000<?echo "\r\n";?>
SUMMARY;LANGUAGE=no:Friday<?echo "\r\n";?>
DESCRIPTION;LANGUAGE=no:Oppgave: Friday\n<?echo "\r\n";?>
LOCATION;LANGUAGE=no:Timenesveien 33<?echo "\r\n";?>
BEGIN:VALARM<?echo "\r\n";?>
TRIGGER:-PT15M<?echo "\r\n";?>
ACTION:DISPLAY<?echo "\r\n";?>
DESCRIPTION:Reminder<?echo "\r\n";?>
END:VALARM<?echo "\r\n";?>
END:VEVENT<?echo "\r\n";?>
END:VCALENDAR

Solution

  • After further testing it seems to work if I remove the WKST rule.

    WKST=MO
    

    After all, the default value of WKST is MO.