From: Chuck Hagenbuch Date: Mon, 2 Feb 2009 19:21:27 +0000 (-0500) Subject: tweaks now that Date_Span is implemented X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=472e1255b90ddda4b1bd20a220dc86271742bd51;p=horde.git tweaks now that Date_Span is implemented --- diff --git a/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base/Repeater/Day.php b/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base/Repeater/Day.php index db131e3b6..98a3bc5ac 100644 --- a/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base/Repeater/Day.php +++ b/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base/Repeater/Day.php @@ -50,7 +50,7 @@ class Horde_Date_Parser_Locale_Base_Repeater_Day extends Horde_Date_Parser_Local public function offset($span, $amount, $pointer) { $direction = ($pointer == 'future') ? 1 : -1; - return $span->add($direction * $amount * self::DAY_SECONDS); + return $span->add(array('day' => $direction * $amount)); } public function width() diff --git a/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base/Repeater/DayPortion.php b/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base/Repeater/DayPortion.php index 37e351dd9..153db39ba 100644 --- a/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base/Repeater/DayPortion.php +++ b/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base/Repeater/DayPortion.php @@ -91,11 +91,12 @@ class Horde_Date_Parser_Locale_Base_Repeater_DayPortion extends Horde_Date_Parse } else { switch ($pointer) { case 'future': - $this->currentSpan->add(array('day' => 1)); + $this->currentSpan = $this->currentSpan->add(array('day' => 1)); break; case 'past': - $this->currentSpan->sub(array('day' => 1)); + $this->currentSpan = $this->currentSpan->add(array('day' => -1)); + break; } } diff --git a/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base/Repeater/Week.php b/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base/Repeater/Week.php index 356c66019..92f2b6ccd 100644 --- a/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base/Repeater/Week.php +++ b/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base/Repeater/Week.php @@ -75,7 +75,7 @@ class Horde_Date_Parser_Locale_Base_Repeater_Week extends Horde_Date_Parser_Loca public function offset($span, $amount, $pointer) { $direction = ($pointer == 'future') ? 1 : -1; - return $span->add($direction * $amount * self::WEEK_SECONDS); + return $span->add(array('day' => $direction * $amount * 7)); } public function width()