projects
/
horde.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d84ea9
)
allow any arg format that Horde_Date will take to simplify creating spans
author
Chuck Hagenbuch
<chuck@horde.org>
Sun, 24 May 2009 22:35:31 +0000
(18:35 -0400)
committer
Chuck Hagenbuch
<chuck@horde.org>
Sun, 24 May 2009 22:35:31 +0000
(18:35 -0400)
framework/Date_Parser/lib/Horde/Date/Span.php
patch
|
blob
|
history
diff --git
a/framework/Date_Parser/lib/Horde/Date/Span.php
b/framework/Date_Parser/lib/Horde/Date/Span.php
index
6af2c7e
..
ad5900c
100644
(file)
--- 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;
}