From: Chuck Hagenbuch Date: Thu, 21 May 2009 00:15:52 +0000 (-0400) Subject: fix off-by-one calculating month start/end X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4776dc246d87a6bd7438cd24690ffad93adc081e;p=horde.git fix off-by-one calculating month start/end --- diff --git a/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base.php b/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base.php index da4b3f54a..aebd948fa 100644 --- a/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base.php +++ b/framework/Date_Parser/lib/Horde/Date/Parser/Locale/Base.php @@ -328,7 +328,7 @@ class Horde_Date_Parser_Locale_Base $year = $tokens[1]->getTag('scalar_year'); try { - return new Horde_Date_Span(new Horde_Date(array('year' => $year, 'month' => $month)), new Horde_Date(array('year' => $year, 'month' => $month + 1))); + return new Horde_Date_Span(new Horde_Date(array('year' => $year, 'month' => $month, 'day' => 1)), new Horde_Date(array('year' => $year, 'month' => $month + 1, 'day' => 1))); } catch (Exception $e) { return null; }