nwcell / ics.js

A browser firendly VCS file generator written entirely in javascript!!!!!!
MIT License
620 stars 258 forks source link

Fixed all day events handling #65

Open michael-maltsev opened 5 years ago

michael-maltsev commented 5 years ago

All day event handling is broken. At least, Google Calendar on Android doesn't import it correctly. That's true for the following usage, which is given as an example in the readme:

cal.addEvent('Demo Event', 'This is an all day event', 'Nome, AK', '8/7/2013', '8/7/2013');

The current result is:

DTSTART;VALUE=DATE-TIME:20130807
DTEND;VALUE=DATE-TIME:20130807

According to this StackOverflow discussion, the correct result should be:

DTSTART;VALUE=DATE:20130807

i.e. a DATE instead of a DATE-TIME, and no DTEND if that's a single day. That's what this pull request does.