Menu

Wrong All Day Events

Anonymous
2014-10-10
2014-10-11
  • Anonymous

    Anonymous - 2014-10-10

    Hi,

    if I read a calendar with all-day events ("DTSTART;VALUE=DATE:20150701") the event.getDateStart().hasTime() gets correctly false. But if I try to export them, they transform to midnight events ("DTSTART:20150701T000000").

    What I'm doing wrong?

    • Timon
     
  • Michael Angstadt

    Hi Timon,

    This is a known issue (see Ticket 7). The fix will be included in the next stable release.

    Workaround: Tweak the DTSTART property before writing the iCalendar object like so:

    :::java
    String str =
    "BEGIN:VCALENDAR\r\n" +
      "VERSION:2.0\r\n" +
      "BEGIN:VEVENT\r\n" +
        "DTSTART;VALUE=DATE:20140930\r\n" +
      "END:VEVENT\r\n" +
    "END:VCALENDAR";
    ICalendar ical = Biweekly.parse(str).first();
    
    DateStart dtstart = ical.getEvents().get(0).getDateStart();
    dtstart.setRawComponents(null);
    
    System.out.println(Biweekly.write(ical).go());
    
     

Anonymous
Anonymous

Add attachments
Cancel