[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdepim/libkcal
From:       Reinhold Kainhofer <reinhold () kainhofer ! com>
Date:       2005-08-31 14:50:31
Message-ID: 1125499831.302041.6095.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 455447 by kainhofe:

For all-day events the DTEND should be set to the last day of the event, 
not to the next day after the event (We misunderstood rfc 2445 in this 
regard). E.g. a DTEND: 20050831 *does* occur on August 31 (and end on that 
date). Originally, we also had it that way, but then misunderstood the rfc 
and for kde 3.1 we used the next day after the event as DTEND. Evolution 
and Mozilla do it similarly, but it's wrong, nonetheless. Actually, after 
pointing out the problem to them, the evolution guys will also use the 
correct way.

See http://www.imc.org/ietf-calendar/archive1/msg03648.html (written by 
one of the authors of rfc 2445, so that's kind of authoritative)




 M  +19 -1     compat.cpp  
 M  +1 -0      compat.h  
 M  +2 -2      icalformatimpl.cpp  


--- branches/KDE/3.5/kdepim/libkcal/compat.cpp #455446:455447
@@ -131,6 +131,21 @@
   Compat::fixRecurrence( incidence );
 }
 
+/** We misunderstood rfc 2445 in this regard. For all-day events, the
+    DTEND is the last day of the event. E.g. a DTEND: 20050831 *does*
+    occure on August 31 (and end on that date). Originally, we also
+    had it that way, but then misunderstood the rfc and for kde 3.1
+    we used the next day after the event as DTEND. Evolution and Mozilla
+    do it similarly, but it's wrong, nonetheless.
+
+    See http://www.imc.org/ietf-calendar/archive1/msg03648.html
+ */
+void CompatPre35::fixFloatingEnd( QDate &endDate )
+{
+  endDate = endDate.addDays( -1 );
+}
+
+
 int CompatPre34::fixPriority( int prio )
 {
   if ( 0<prio && prio<6 ) {
@@ -156,7 +171,10 @@
 /** Before kde 3.1, floating events (events without a date) had 0:00 of their
     last day as the end date. E.g. 28.5.2005  0:00 until 28.5.2005 0:00 for an
     event that lasted the whole day on May 28, 2005. According to RFC 2445, the
-    end date for such an event needs to be 29.5.2005 0:00. */
+    end date for such an event needs to be 29.5.2005 0:00.
+
+    Update: We misunderstood rfc 2445 in this regard. For all-day events, the
+    DTEND is the last day of the event. */
 void CompatPre31::fixFloatingEnd( QDate &endDate )
 {
   endDate = endDate.addDays( 1 );
--- branches/KDE/3.5/kdepim/libkcal/compat.h #455446:455447
@@ -63,6 +63,7 @@
 class CompatPre35 : public Compat
 {
   public:
+    virtual void fixFloatingEnd( QDate & );
     virtual void fixRecurrence( Incidence * );
   private:
     class Private;
--- branches/KDE/3.5/kdepim/libkcal/icalformatimpl.cpp #455446:455447
@@ -194,7 +194,7 @@
 //      kdDebug(5800) << " Event " << event->summary() << " floats." << endl;
 //      if (event->dtEnd().date() != event->dtStart().date()) {
         // +1 day because end date is non-inclusive.
-        end = writeICalDate( event->dtEnd().date().addDays( 1 ) );
+        end = writeICalDate( event->dtEnd().date() );
 //      }
     } else {
 //      kdDebug(5800) << " Event " << event->summary() << " has time." << endl;
@@ -958,7 +958,7 @@
         icaltime = icalproperty_get_dtend(p);
         if (icaltime.is_date) {
           // End date is non-inclusive
-          QDate endDate = readICalDate( icaltime ).addDays( -1 );
+          QDate endDate = readICalDate( icaltime );
           if ( mCompat ) mCompat->fixFloatingEnd( endDate );
           if ( endDate < event->dtStart().date() ) {
             endDate = event->dtStart().date();
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic