Skip to content

v0.8.4

Compare
Choose a tag to compare
@angeloashmore angeloashmore released this 04 Aug 23:02
· 49 commits to master since this release
  • Add support for time-less dates

    When a property that transforms Date values is set with VALUE=DATE, the time is not included when generating the ICS data.

    Example:

    const event = new ICS.VEVENT();
    
    // VALUE=DATE
    event.addProp('DTSTAMP', new Date('1991-07-11'), { VALUE: 'DATE' });
    
    // VALUE=DATE-TIME
    event.addProp('DTSTART', new Date('1991-07-11 10:00:00'), { VALUE: 'DATE-TIME' });
    
    // Without props (DATE-TIME is the default)
    event.addProp('DTEND', new Date('1991-07-11 22:00:00'));
    
    // Non-Date values are passed without transformations
    event.addProp('RDATE', '19910711T190000');

    Return value of event.toString():

    VBEGIN:VEVENT
    DTSTAMP:19910711
    DTSTART:19910711T100000
    DTEND:19910711T220000
    RDATE:19910711T190000
    VEND:VEVENT