0

简单的介绍

我的 PHP 生成的 iCalendar 文件中的重复事件不会在 IOS 应用程序中正确重复。它们确实在 Outlook 2010 和 Google 日历中正确重现,但在 IOS 8.1(iPhone 5S 和 iPad 2)中不正确。

细节

以下文件生成适合从 MS Outlook 和 Google 日历等应用程序订阅的日历文件。该文件包含一个 VTIMEZONE 和一个 VEVENT,意味着在 2014 年 11 月 7 日至 28 日的每个星期五重复出现,总共重复四次。

iCalendar 文件:http ://www.elitesystemer.no/mycal_stack_example.php (完整代码如下)

在我的两个 iDevices(IOS 8.1)上,这个事件只发生一次;2014 年 11 月 7 日。这种奇怪的行为适用于本机日历应用程序以及周历应用程序(网站:http ://weekcal.com )。

该文件与 MS Outlook 2010 和 Google 日历完美配合,但不适用于 IOS。不幸的是,我无法在 Apple 论坛上找到任何类似的问题。我既无法使用具有以前操作系统版本的 iDevice 进行测试,也无法使用其他智能手机进行测试。

我已经在http://icalvalid.cloudapp.net/http://severinghaus.org/projects/icv/等在线 iCalendar 验证器上测试了该文件- 完美的结果没有警告/错误。

从 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:f8a81b8613113296503aa6fca2b61ce5@elitesystemer.no<?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
4

2 回答 2

0

Mindblowing but it seems that ios simply does not do recurring events by day of week - a quick google found this Jan 2014 post:

The ability to schedule recurring events by day of the week is missing in action on iOS.

http://www.macworld.com/article/2091041/scheduling-recurring-events-on-ios.html the link has some suggestions around it. (and I love the final paragraph suggestion!)

I use google calendar on my iphone so I haven't noticed this before and find it hard to believe, but clearly it is a problem.

The only other way around it that I can think of is to offer an ics feed for apple calendar users that generates RDATE's for the recurring instances, rather than the RRULE. Surely it should load those?

于 2014-11-11T22:38:36.943 回答
0

经过进一步测试,如果我删除 WKST 规则,它似乎可以工作。

WKST=MO

毕竟,WKST 的默认值是 MO。

于 2014-11-12T11:33:23.563 回答