From: Chuck Hagenbuch Date: Fri, 22 May 2009 02:18:36 +0000 (-0400) Subject: need to specify 1st day of the month for dates to be handled correcctly X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f2d5c9f22cdb0700fd60c77f21c304b7826eb7fd;p=horde.git need to specify 1st day of the month for dates to be handled correcctly --- 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; }