[#6377] recurrence end date / fix off-by-one-day issue
Summary recurrence end date / fix off-by-one-day issue
Queue Kronolith
Queue Version 2.2-RC2
Type Bug
State Assigned
Priority 1. Low
Owners Jan Schneider <jan (at) horde (dot) org>
Requester m (dot) gabriel (at) das-netzwerkteam (dot) de
Created 03/05/2008 (67 days ago)
Due
Updated 03/10/2008 (62 days ago)
Assigned 03/05/2008 (67 days ago)
Resolved
Attachments kronolith-recurrence.patch Download
Milestone 2.2
Patch

History
03/10/2008 m (dot) gabriel (at) das-netzwerkteam (dot) de Comment #4 Reply to this comment
hi ,

gone through my bug report history. this actually a follow up of
http://bugs.horde.org/ticket/?id=6265

mike
03/06/2008 Jan Schneider Milestone ⇒ 2.2
 
03/05/2008 Chuck Hagenbuch Comment #3
State ⇒ Assigned
Assigned to Jan Schneider
Reply to this comment
Jan put those fixme comments in there, so I'm passing this one to him. Thanks!
03/05/2008 m (dot) gabriel (at) das-netzwerkteam (dot) de Comment #2 Reply to this comment
i guess this should also go into lib/Horde/Date/Recurrence.php
03/05/2008 m (dot) gabriel (at) das-netzwerkteam (dot) de Comment #1
New Attachment: kronolith-recurrence.patch Download
Queue ⇒ Kronolith
Summary ⇒ recurrence end date / fix off-by-one-day issue
Type ⇒ Bug
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Reply to this comment
in kronolith/lib/Recurrence.php there were some marks pointing at an off-by-one-day issue.

reproduce it:

use the kolab driver.

create a (kolab) event (20th of march), define daily recurrence and also define an end date for recurrence (30th of march). in kronolith the last entry in the calendar will be on the 29th. recurrency ends on the 30th march at 0:00am.

in kolab xml events you can obviously only store date-only hashes for recur end date (not time component). at least, this is what the new/XML kolab driver in horde does...

my fix for this issues does the following. it adds some hours and minutes to the recur end date (23:59h) and then the last event of the recurrence is displayed correctly.

--- a/kronolith/lib/Recurrence.php      2007-11-29 12:33:10.000000000 +0000
+++ b/kronolith/lib/Recurrence.php      2008-03-05 16:26:28.000000000 +0000
@@ -1156,10 +1156,8 @@
             break;

         case 'date':
-            // fix off-by-one day
-            //FIXME
             $timestamp = Kolab_Date::decodeDate($hash['range']);
-            $this->setRecurEnd(new Horde_Date($timestamp + 86400));
+            $this->setRecurEnd(new Horde_Date($timestamp + 86340));
             break;
         }

@@ -1352,10 +1350,7 @@
             $hash['range-type'] = 'number';
             $hash['range'] = $this->getRecurCount();
         } elseif ($this->hasRecurEnd()) {
-            // Fix of-by-one day.
             $date = $this->getRecurEnd();
-            $date->mday -= 1;
-            $date->correct();
             $hash['range-type'] = 'date';
             $hash['range'] = Kolab_Date::encodeDate($date->timestamp());
         } else {