Skip to content

Commit 84d280a

Browse files
committed
Allow date classes that extend DateTimeInterface
1 parent 7954312 commit 84d280a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Valid.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public static function freq($frequency)
211211
*/
212212
public static function dateTimeObject($dateTime)
213213
{
214-
return (is_object($dateTime) && $dateTime instanceof \DateTime);
214+
return (is_object($dateTime) && ($dateTime instanceof \DateTimeInterface));
215215
}
216216

217217
/**

src/When.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public function rrule($rrule)
305305
return $this;
306306
}
307307

308-
public function occursOn(DateTime $date)
308+
public function occursOn(\DateTimeInterface $date)
309309
{
310310
if (!Valid::dateTimeObject($date))
311311
{

0 commit comments

Comments
 (0)