Ical VALARM 未注册

2022-01-11 00:00:00 icalendar calendar php

最近几天我创建了一个构建 .ics 文件 (ical) 的应用程序

I've used the last couple of days creating an application that constructs an .ics file (ical)

它是用 php 编码的,基本功能可以正常工作(时区、Vevent 等),但是当我将 VALARM 添加到这些 VEVENT 的既不是谷歌日历中,也不是 Outlook 2010 中,会将通知添加到他们的日历中

It's coded in php, and the base functions work fine (timezones, Vevent's, and so on) but when i add VALARM's into those VEVENT's neither google calendar, nor Outlook 2010 add's the nofifications to their calendar's

ics 文件的片段:

BEGIN:VEVENT
UID:f2f5672145d92702c71504ceccf77167@dyndns.org
DTSTAMP:20120420T174122Z
DTSTART;TZID=Europe/Berlin:20120416T081000
DTEND;TZID=Europe/Berlin:20120416T091000
LOCATION:A102 - Teori Frh.
SUMMARY:Hold: 2.B Kemi B
DESCRIPTION:Lærer: Jeppe Byrialsen Jensen (JBJ) Noter: Lab øvelser om alkoholers blandbarhed
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:Hold: 2.B Kemi B
TRIGGER:-P0DT0H30M0S
END:VALARM
END:VEVENT

如果您从文件中导入它似乎可以工作,但遗憾的是我需要从网站导入它.

It seems to work if you import it from a file, but sadly i need to import it from a website.

推荐答案

我们遇到了同样的问题,但是发现每行末尾使用 的示例代码片段需要使用 <代码> 代替.

We had the same problem, but found that example code snippets which use at the end of each line need to use instead.

http://severinghaus.org/projects/icv/ 上的 iCal 验证器将其突出显示为警告,尽管 iCal 文件正常工作,但 Outlook 2010 中未设置提醒警报.

The iCal validator at http://severinghaus.org/projects/icv/ highlighted this as a warning, despite the iCal files working except for the reminder alarm not being set in Outlook 2010.

这是一个示例 iCal 文件,它在 Outlook 2010 中打开时完全符合预期,包括将提醒设置为 1 小时(只要换行符为 ):

Here is an example iCal file which works exactly as expected when opened in Outlook 2010, including setting the reminder to 1 hour (as long as the line breaks are ):

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Keeble Smith//NONSGML GETONCOURT.COM//EN
BEGIN:VEVENT
DTSTART:20130514T190000Z
DTEND:20130514T194000Z
LOCATION:Court 2, Demo Squash Club
DESCRIPTION:View this court booking on getoncourt.com: http://democlub.getoncourt.com/booking-details/dmo3106
SUMMARY:Squash court booking for John Smith - DMO3106
BEGIN:VALARM
TRIGGER:-PT60M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR

还要注意转义的特殊字符.确保在 TEXT 值中转义以下内容(但不是 EOL 实例):

Note also the escaped special characters. Ensure you escape the following in TEXT values (not the EOL instance though):

  to  \
;  to  ;
,  to  ,

 to  \n

相关文章