From: Chuck Hagenbuch Date: Sun, 24 May 2009 22:35:31 +0000 (-0400) Subject: allow any arg format that Horde_Date will take to simplify creating spans X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=db17d0eb72672d19a33b51be16ff54053d5b7adb;p=horde.git allow any arg format that Horde_Date will take to simplify creating spans --- 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; }