fix calculation of the new span endpoint
authorChuck Hagenbuch <chuck@horde.org>
Wed, 13 May 2009 01:04:01 +0000 (21:04 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Wed, 13 May 2009 01:04:37 +0000 (21:04 -0400)
framework/Date_Parser/lib/Horde/Date/Repeater/DayPortion.php

index 36ff50d..f87395b 100644 (file)
@@ -109,8 +109,7 @@ class Horde_Date_Repeater_DayPortion extends Horde_Date_Repeater
         parent::this($context);
 
         $rangeStart = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day, 'sec' => $this->range[0]));
-        $rangeEnd = new Horde_Date(array('year' => $rangeStart->year, 'month' => $rangeStart->month, 'day' => $rangeStart->day, 'sec' => $this->range[1] - $this->range[0]));
-        $this->currentSpan = new Horde_Date_Span($rangeStart, $rangeEnd);
+        $this->currentSpan = new Horde_Date_Span($rangeStart, $rangeStart->add($this->range[1] - $this->range[0]));
         return $this->currentSpan;
     }