From db17d0eb72672d19a33b51be16ff54053d5b7adb Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Sun, 24 May 2009 18:35:31 -0400 Subject: [PATCH] allow any arg format that Horde_Date will take to simplify creating spans --- framework/Date_Parser/lib/Horde/Date/Span.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/framework/Date_Parser/lib/Horde/Date/Span.php b/framework/Date_Parser/lib/Horde/Date/Span.php index 6af2c7e2d..ad5900c82 100644 --- a/framework/Date_Parser/lib/Horde/Date/Span.php +++ b/framework/Date_Parser/lib/Horde/Date/Span.php @@ -20,8 +20,17 @@ class Horde_Date_Span */ public $end; + /** + * Constructor + * + * @param mixed $begin Horde_Date or other format accepted by the Horde_Date constructor + * @param mixed $end Horde_Date or other format accepted by the Horde_Date constructor + */ public function __construct($begin, $end) { + if (! $begin instanceof Horde_Date) { $begin = new Horde_Date($begin); } + if (! $end instanceof Horde_Date) { $end = new Horde_Date($end); } + $this->begin = $begin; $this->end = $end; } -- 2.11.0