From 472e1255b90ddda4b1bd20a220dc86271742bd51 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Mon, 2 Feb 2009 14:21:27 -0500 Subject: [PATCH] tweaks now that Date_Span is implemented --- .../Date_Parser/lib/Horde/Date/Parser/Locale/Base/Repeater/Day.php | 2 +- .../lib/Horde/Date/Parser/Locale/Base/Repeater/DayPortion.php | 5 +++-- .../Date_Parser/lib/Horde/Date/Parser/Locale/Base/Repeater/Week.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) 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() -- 2.11.0