From f2d5c9f22cdb0700fd60c77f21c304b7826eb7fd Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Thu, 21 May 2009 22:18:36 -0400 Subject: [PATCH] need to specify 1st day of the month for dates to be handled correcctly --- framework/Date_Parser/lib/Horde/Date/Repeater/Month.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/framework/Date_Parser/lib/Horde/Date/Repeater/Month.php b/framework/Date_Parser/lib/Horde/Date/Repeater/Month.php index 649fab72e..9afba94e1 100644 --- a/framework/Date_Parser/lib/Horde/Date/Repeater/Month.php +++ b/framework/Date_Parser/lib/Horde/Date/Repeater/Month.php @@ -13,7 +13,7 @@ class Horde_Date_Repeater_Month extends Horde_Date_Repeater parent::next($pointer); if (!$this->currentMonthStart) { - $this->currentMonthStart = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month)); + $this->currentMonthStart = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => 1)); } $direction = ($pointer == 'future') ? 1 : -1; $this->currentMonthStart->month += $direction; @@ -30,17 +30,17 @@ class Horde_Date_Repeater_Month extends Horde_Date_Repeater switch ($pointer) { case 'future': $monthStart = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day + 1)); - $monthEnd = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month + 1)); + $monthEnd = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month + 1, 'day' => 1)); break; case 'past': - $monthStart = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month)); + $monthStart = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => 1)); $monthEnd = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day)); break; case 'none': - $monthStart = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month)); - $monthEnd = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month + 1)); + $monthStart = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => 1)); + $monthEnd = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month + 1, 'day' => 1)); break; } -- 2.11.0