Help save net neutrality! Learn more.
Close

Unparseable date "20080330"

Help
2014-06-28
2014-06-29
  • Christophe De Troyer

    I seem to be unable to parse an iCal file in which there are no timestamps supplied.

    E.g.:

    BEGIN:VCALENDAR
    PRODID:Data::ICal 0.16
    VERSION:2.0
    X-WR-CALNAME:MyCal

    BEGIN:VEVENT
    DTSTART:20140709
    SUMMARY:Garbage Collection
    END:VEVENT
    END:VCALENDAR

    causes the following error:

    net.fortuna.ical4j.data.ParserException: Error at line 7:[DTSTART] Unparseable date: "20140709"

     
  • Ben Fortuna

    Ben Fortuna - 2014-06-29

    Hi Christopher,

    The default DTSTART format requires a timestamp, so for this to be valid it should have a VALUE=DATE parameter. ie.

    DTSTART;VALUE=DATE:20140709

    However if you want to parse this file as is, you can enable relaxed parsing by creating a file called ical4j.properties in the root of your classpath with the following content:

    ical4j.parsing.relaxed=true

    regards,
    ben

     

Log in to post a comment.