fullcalendaricalendarrfc5545rfc2445

rfc2445, how to store all day events?


I'm creating a calendar application which should be complaint with rfc-2445 specification. I've had a few issue with the All Day events here but now it has been resolved, you can see the SO question here but it forced me to ask the following question.

The matter that when I choose All Day event for example from 20-10-2015 up to 21-10-2015 (duration of the event is 2 days) actually I need to create record in DB from 20-10-2015 up to 22-10-2015, otherwise it will shown as one day event.

And my question has two part:

  1. Is the above right and according to standard rfc-2445?
  2. Should I store such event in DB as from 20-10-2015 to 22-10-2015 and when show its details to end user I should decrease one day from end date or store it as 20-10-2015 to 21-10-2015 and increase by one day at end date when render it inside the calendar.

Thank you.


Solution

  • The DTEND property corresponds to the non-inclusive end of the event, so, your above example is correct

    See https://www.rfc-editor.org/rfc/rfc5545#section-3.6.1 which specifies:

    The "DTSTART" property for a "VEVENT" specifies the inclusive start of the event. For recurring events, it also specifies the very first instance in the recurrence set. The "DTEND" property for a "VEVENT" calendar component specifies the non-inclusive end of the event.

    and also has an example of a multiday allday event:

    The following is an example of the "VEVENT" calendar component used to represent a multi-day event scheduled from June 28th, 2007 to July 8th, 2007 inclusively. Note that the "DTEND" property is set to July 9th, 2007, since the "DTEND" property specifies the non-inclusive end of the event.

       BEGIN:VEVENT
       UID:20070423T123432Z-541111@example.com
       DTSTAMP:20070423T123432Z
       DTSTART;VALUE=DATE:20070628
       DTEND;VALUE=DATE:20070709
       SUMMARY:Festival International de Jazz de Montreal
       TRANSP:TRANSPARENT
       END:VEVENT
    

    You would have noticed that I'm refering to RFC5545 which has obsoleted RFC2445.