Exclusive/Inclusive DTEND according to RFC5545 and Fullcalendar in event with time part, how to do it right?

匆匆过客 提交于 2019-12-25 06:49:50

问题


According to rfc5545:

The "DTEND" property for a "VEVENT" calendar component specifies the non-inclusive end of the event.

Also in fullcalendar documentation for end property of event object written the same:

The exclusive date/time an event ends. Optional.

A Moment-ish input, like an ISO8601 string. Throughout the API this will become a real Moment object.

It is the moment immediately after the event has ended. For example, if the last full day of an event is Thursday, the exclusive end of the event will be 00:00:00 on Friday!

With allday event everything is clear, if event from 24/03/2016 to 25/03/2016 I need to write according to described above from 24/03/2016 to 25/03/2016.

Now, my question is how I supposed to write in DTEND when event from 24/03/2016 10:00 to 24/03/2016 10:30, i.e. 30 min event? Do I need to write 24/03/2016 10:30:01 to create non-inclusive end date?


回答1:


Your understanding of the RFC5545 is correct, it is your math which is failing you:

Say you want to have a 1 min event you would have

DTSTART:20160324T173000Z
DTEND:20160324T173100Z

Similarly for a 30 min event you would have:

DTSTART:20160324T173000Z
DTEND:20160324T180000Z



来源:https://stackoverflow.com/questions/36206278/exclusive-inclusive-dtend-according-to-rfc5545-and-fullcalendar-in-event-with-ti

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