0

我在我的网站中使用 ical 和 darwin。当我使用 rrule 创建一个事件时,当事件有 byday 和 count 时它失败了。例如:成功 1(每周且不计):

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//ZHAOXI//iCalendar 1.0.0//
BEGIN:VEVENT
UID:20130410T020715CST-05076UU95w@ZHAOXI
DTSTAMP:20130409T180715Z
CLASS:PUBLIC
DTSTART:20130411T110000
DTEND:20130411T150000
ORGANIZER;SCHEDULE-AGENT=NONE;SCHEDULE-STATUS=5.3:MAILTO:user_3@zhaoxi.me
RRULE:FREQ=WEEKLY;BYDAY=TH,SA
SEQUENCE:0
SUMMARY:ssssss
X-ZX-RESPONSE:Y
END:VEVENT
BEGIN:VEVENT
UID:20130410T020715CST-05076UU95w@ZHAOXI
DTSTAMP:20130409T180718Z
CLASS:PUBLIC
DTSTART:20130413T130000
DTEND:20130413T170000
ORGANIZER:MAILTO:user_3@zhaoxi.me
RECURRENCE-ID:20130413T110000
SEQUENCE:1
SUMMARY:ssssss
X-ZX-RESPONSE:Y
END:VEVENT
END:VCALENDAR

成功2(每天计数):

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//ZHAOXI//iCalendar 1.0.0//
BEGIN:VEVENT
UID:20130410T021754CST-68882mJ5aU@ZHAOXI
DTSTAMP:20130409T181754Z
CLASS:PUBLIC
DTSTART:20130416T173000
DTEND:20130416T200000
ORGANIZER;SCHEDULE-AGENT=NONE;SCHEDULE-STATUS=5.3:MAILTO:user_3@zhaoxi.me
RRULE:FREQ=DAILY;COUNT=10
SEQUENCE:0
SUMMARY:sdf
X-ZX-RESPONSE:Y
END:VEVENT
BEGIN:VEVENT
UID:20130410T021754CST-68882mJ5aU@ZHAOXI
DTSTAMP:20130409T181805Z
CLASS:PUBLIC
DTSTART:20130417T190000
DTEND:20130417T213000
ORGANIZER:MAILTO:user_3@zhaoxi.me
RECURRENCE-ID:20130417T173000
SEQUENCE:1
SUMMARY:sdf
X-ZX-RESPONSE:Y
END:VEVENT
BEGIN:VEVENT
UID:20130410T021754CST-68882mJ5aU@ZHAOXI
DTSTAMP:20130409T181850Z
CLASS:PUBLIC
DTSTART:20130419T183000
DTEND:20130419T210000
ORGANIZER:MAILTO:user_3@zhaoxi.me
RECURRENCE-ID:20130419T173000
SEQUENCE:1
SUMMARY:sdf
X-ZX-RESPONSE:Y
END:VEVENT
END:VCALENDAR

失败1:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//ZHAOXI//iCalendar 1.0.0//
BEGIN:VEVENT
UID:20130410T015311CST-3605lc7xEv@ZHAOXI
DTSTAMP:20130409T175311Z
CLASS:PUBLIC
DTSTART:20130411T050000
DTEND:20130411T083000
ORGANIZER;SCHEDULE-AGENT=NONE;SCHEDULE-STATUS=5.3:MAILTO:user_3@zhaoxi.me
RRULE:FREQ=WEEKLY;UNTIL=20130420T050000Z;BYDAY=TH,SA
SEQUENCE:0
SUMMARY:dddddddd
X-ZX-RESPONSE:Y
END:VEVENT
BEGIN:VEVENT
UID:20130410T015311CST-3605lc7xEv@ZHAOXI
DTSTAMP:20130409T180755Z
CLASS:PUBLIC
DTSTART:20130413T070000
DTEND:20130413T103000
ORGANIZER:MAILTO:user_3@zhaoxi.me
RECURRENCE-ID:20130413T053000
SEQUENCE:1
SUMMARY:dddddddd
X-ZX-RESPONSE:Y
END:VEVENT
END:VCALENDAR

我认为差异是规则,但我找不到原因~

4

2 回答 2

2

您的主组件有

DTSTART:20130411T050000

但你的例外有

重复 ID:20130413T053000

重复 ID 应始终匹配事件的(扩展)实例之一。日期部分是正确的(20130413 是第一个实例之后的星期六),但是当第一个实例显示的时间部分为 050000 时,时间部分为 053000。

换句话说,您的重复 ID 应该是:

重复 ID:20130413T050000

于 2013-04-10T14:53:55.210 回答
0

您的规则没有任何问题,但是 RFC5545 §3.8.4.7 指定 "UID" itself MUST be a globally unique identifier并且在您的所有 3 个 icalendar 文件中您使用的是相同的 UID。您是否尝试过使用不同 UID 的每个事件来查看服务器如何处理它?

于 2013-04-10T13:22:18.550 回答