iCal feed all day events blank out entire day

一笑奈何 提交于 2019-12-11 14:54:38

问题


I am using a very old version of Telerik RadScheduler that exports appointments to an ics file so they can be fed to an iPhone.

This is the telerik code:

 TimeZoneInfo localZone = TimeZoneInfo.Local;
 TimeSpan ts = localZone.BaseUtcOffset;
 return RadScheduler.ExportToICalendar(scheduler.Appointments, ts);`

My server is in GMT, my iPhone is in NZDT (+13), my appointments are stored in UTC.

I have some all day appointments that are midnight til midnight NZDT time. They are exporting like this:

 BEGIN:VEVENT DTSTART:20141205T110000Z 
 DTEND:20141206T110000Z
 UID:20141202T140355Z-907 
 DTSTAMP:20141202T140355Z SUMMARY: Day Off
 DESCRIPTION:Own Day END:VEVENT

When they display on the iPhone they don't show as all day events, they just blank out the whole day midnight to midnight as an appointment.

I am very willing to re-write the ical myself if it is wrong but I don't know what it should be. I have searched google for examples of iCal all day events but I can't find any proper documentation (maybe looking in the wrong place), and what I am finding appears to be inconsistent.

What I want to know is, is this something to do with the timezone or is the output incorrect? What should the start and end times be for all day events, or is there a key for "all day events" that needs to be added?


回答1:


not 100% sure about how iOS implements it but the RFC5545 3.6.1says:

[...]The "DTEND" property for a "VEVENT" calendar component specifies the non-inclusive end of the event. For cases where a "VEVENT" calendar component specifies a "DTSTART" property with a DATE value type but no "DTEND" nor "DURATION" property, the event's duration is taken to be one day.[...]

so in your case you should try to remove the DTEND property.



来源:https://stackoverflow.com/questions/27251663/ical-feed-all-day-events-blank-out-entire-day

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!