File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Cmfcmf/OpenWeatherMap/Util Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -47,16 +47,16 @@ class Time
4747 public function __construct ($ from , $ to = null )
4848 {
4949 if (isset ($ to )) {
50- $ from = (is_a ($ from , 'DateTime ' )) ? $ from : new \DateTime ($ from );
51- $ to = (is_a ($ to , 'DateTime ' )) ? $ to : new \DateTime ($ to );
50+ $ from = (! is_string ( $ from ) && is_a ($ from , 'DateTime ' )) ? $ from : new \DateTime ($ from );
51+ $ to = (! is_string ( $ to ) && is_a ($ to , 'DateTime ' )) ? $ to : new \DateTime ($ to );
5252 $ day = new \DateTime ($ from ->format ('Y-m-d ' ));
5353 } else {
54- $ from = (is_a ($ from , 'DateTime ' )) ? $ from : new \DateTime ($ from );
54+ $ from = (! is_string ( $ from ) && is_a ($ from , 'DateTime ' )) ? $ from : new \DateTime ($ from );
5555 $ day = clone $ from ;
5656 $ to = clone $ from ;
5757 $ to = $ to ->add (new \DateInterval ('PT23H59M59S ' ));
5858 }
59-
59+
6060 $ this ->from = $ from ;
6161 $ this ->to = $ to ;
6262 $ this ->day = $ day ;
You can’t perform that action at this time.
0 commit comments