Skip to content

Commit cc240fa

Browse files
committed
Fixed fatal error, closes #8.
1 parent 53e6c97 commit cc240fa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Cmfcmf/OpenWeatherMap/Util/Time.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ class Time
4747
public function __construct($from, $to = null)
4848
{
4949
if (isset($to)) {
50-
$from = (is_object($from)) ? $from : new \DateTime($from);
51-
$to = (is_object($to)) ? $to : new \DateTime($to);
50+
$from = (is_a($from, 'DateTime')) ? $from : new \DateTime($from);
51+
$to = (is_a($to, 'DateTime')) ? $to : new \DateTime($to);
5252
$day = new \DateTime($from->format('Y-m-d'));
5353
} else {
54-
$from = (is_object($from)) ? $from : new \DateTime($from);
54+
$from = (is_a($from, 'DateTime')) ? $from : new \DateTime($from);
5555
$day = clone $from;
5656
$to = clone $from;
5757
$to = $to->add(new \DateInterval('PT23H59M59S'));

0 commit comments

Comments
 (0)