fix RepeaterDayPortion offset() method, and don't lose seconds in RepeaterDayPortion...
authorChuck Hagenbuch <chuck@horde.org>
Fri, 22 May 2009 02:50:30 +0000 (22:50 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Fri, 22 May 2009 15:57:32 +0000 (11:57 -0400)
framework/Date_Parser/lib/Horde/Date/Repeater/DayPortion.php

index f87395b..ee63cc2 100644 (file)
@@ -87,7 +87,7 @@ class Horde_Date_Repeater_DayPortion extends Horde_Date_Repeater
                 }
             }
 
-            $rangeEnd = new Horde_Date(array('year' => $rangeStart->year, 'month' => $rangeStart->month, 'day' => $rangeStart->day, 'sec' => $this->range[1] - $this->range[0]));
+            $rangeEnd = $rangeStart->add($this->range[1] - $this->range[0]);
             $this->currentSpan = new Horde_Date_Span($rangeStart, $rangeEnd);
         } else {
             switch ($pointer) {
@@ -118,7 +118,7 @@ class Horde_Date_Repeater_DayPortion extends Horde_Date_Repeater
         $this->now = $span->begin;
         $portionSpan = $this->next($pointer);
         $direction = ($pointer == 'future') ? 1 : -1;
-        return $portionSpan + ($direction * ($amount - 1) * Horde_Date_Repeater_Day::DAY_SECONDS);
+        return $portionSpan->add(array('day' => $direction * ($amount - 1)));
     }
 
     public function width()