Parse ...Z date strings to local time correctly
This commit is contained in:
@@ -144,7 +144,7 @@ class Controller extends BaseController
|
||||
|
||||
protected static function JsonToDateTime($obj)
|
||||
{
|
||||
return is_object($obj) ? new \DateTime($obj->date, new \DateTimeZone($obj->timezone)) : new \DateTime($obj);
|
||||
return is_object($obj) ? new \DateTime($obj->date, new \DateTimeZone($obj->timezone)) : \Carbon\Carbon::parse($obj)->setTimezone(date_default_timezone_get());
|
||||
}
|
||||
|
||||
public function __call($method, $arguments)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
{{$item['program']->name}}
|
||||
</div>
|
||||
<div class="program-times"><i class="fa-regular fa-clock"></i>
|
||||
{{$item['starttime']->format('H:i')}} – {{$item['endtime']->format('H:i')}}
|
||||
{{$item['starttime']->format('H:i')}} – {{$item['endtime']->format('H:i')}}
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
@@ -26,5 +26,5 @@
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
|
||||
@endforeach
|
||||
|
||||
Reference in New Issue
Block a user