Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#29 Fix for N900's incorrect "All day event"

open
nobody
None
5
2013-04-20
2013-04-20
Anonymous
No

My N900 sends time (00:00:00) for calendar event even it's a All day event. Then DavMail believes that it's a normal event and isAllDay returns False.

Then the event exposes itself to two days in KOrganizer and in Outlook Web App (because this event begins from 00:00:00 and ends on 00:00:00 on next day).

I fixed this issue: http://pastebin.com/GTJ73Nuv (it's an ugly hack, but it does what it should).

Discussion


  • Anonymous
    2013-04-20

    Oh, patched file is src/java/davmail/exchange/VCalendar.java

     

  • Anonymous
    2013-05-22

    # diff VCalendar.java_works_with_n900 VCalendar.java.orig

    117,146d116
    < VProperty dtend = vObject.getProperty("DTEND");
    < String tmp1 = dtstart.getValue();
    < String tmp2 = dtend.getValue();
    <
    < // Fix for N900 (it sends All day events in wrong format)
    < // 2013-04-20 - VatVit
    < if (tmp1.length() >= 7 && tmp2.length() >= 7) {
    < String tmp11 = tmp1.substring(tmp1.length() - 7);
    < String tmp22 = tmp2.substring(tmp2.length() - 7);
    < if ( tmp11.equals("T000000") && tmp22.equals("T000000") ) {
    < LOGGER.warn("Wrongly formatted all day event: Correcting it... " + dtstart);
    < tmp1 = tmp1.replaceAll("T000000$", "");
    < tmp2 = tmp2.replaceAll("T000000$", "");
    < tmp1 = tmp1.replaceAll("^DTSTART:", "");
    < tmp2 = tmp2.replaceAll("^DTEND:", "");
    < vObject.removeProperty("DTSTART");
    < vObject.removeProperty("DTEND");
    <
    < VProperty singleProperty1 = new VProperty("DTSTART", tmp1);
    < singleProperty1.addParam("VALUE", "DATE");
    < vObject.addProperty(singleProperty1);
    <
    < VProperty singleProperty2 = new VProperty("DTEND", tmp2);
    < singleProperty2.addParam("VALUE", "DATE");
    < vObject.addProperty(singleProperty2);
    <
    < dtstart = vObject.getProperty("DTSTART");
    < dtend = vObject.getProperty("DTEND");
    < }
    < }

     
  • Well, this patch is indeed a bit "quick and dirty", would need to improve it before merge...