[Tickets #6377] recurrence end date / fix off-by-one-day issue

bugs at horde.org bugs at horde.org
Wed Mar 5 17:05:50 UTC 2008


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/6377
-----------------------------------------------------------------------
 Ticket             | 6377
 Created By         | m.gabriel at das-netzwerkteam.de
 Summary            | recurrence end date / fix off-by-one-day issue
 Queue              | Kronolith
 Version            | 2.2-RC2
 Type               | Bug
 State              | Unconfirmed
 Priority           | 1. Low
 Milestone          | 
 Patch              | 
 Owners             | 
+New Attachment     | kronolith-recurrence.patch
-----------------------------------------------------------------------


m.gabriel at das-netzwerkteam.de (2008-03-05 12:05) wrote:

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 {




More information about the bugs mailing list