[#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 Resolved
Priority 1. Low
Owners jan (at) horde (dot) org
Requester m.gabriel (at) das-netzwerkteam (dot) de
Created 2008-03-05 (4064 days ago)
Updated 2008-05-25 (3983 days ago)
Assigned 2008-05-17 (3991 days ago)
Resolved 2008-05-25 (3983 days ago)
Milestone 2.2
Patch No

2008-05-25 19:11:05 Chuck Hagenbuch Comment #7
State ⇒ Resolved
Reply to this comment
Going to guess this is fixed for now.
2008-05-23 19:17:21 Chuck Hagenbuch Comment #6 Reply to this comment
2008-05-17 20:47:27 Jan Schneider Comment #5
State ⇒ Feedback
Reply to this comment
Both Gunnar's original code and your fix didn't look correct to me, 
please try what I committed.
2008-03-10 18:46:31 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


2008-03-06 10:39:40 Jan Schneider Milestone ⇒ 2.2
2008-03-05 22:25:24 Chuck Hagenbuch Comment #3
Assigned to Jan Schneider
State ⇒ Assigned
Reply to this comment
Jan put those fixme comments in there, so I'm passing this one to him. Thanks!
2008-03-05 17:46:07 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
2008-03-05 17:05:50 m (dot) gabriel (at) das-netzwerkteam (dot) de Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ recurrence end date / fix off-by-one-day issue
Queue ⇒ Kronolith
New Attachment: kronolith-recurrence.patch Download
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 @@


          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));



@@ -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 {

Saved Queries