Hi!
I have a site with every location in the world and I use suncalc to display sunrise/sunset moonrise/moonset. But randomly, several locations every day will get a fatal error and not load:
Fatal error: Call to a member function format() on a non-object in...
It seems only the moonset object is missing, the other sunrise/sunset and moonrise objects load fine. For now my fix is this:
if(is_object($moonTimes['moonset']))
{
$moonset = $moonTimes['moonset']->format($hour_min_format);
}
at least that stops my page from crashing.
Thanks.
PS love the script by the way :)
Hi!
I have a site with every location in the world and I use suncalc to display sunrise/sunset moonrise/moonset. But randomly, several locations every day will get a fatal error and not load:
Fatal error: Call to a member function format() on a non-object in...
It seems only the moonset object is missing, the other sunrise/sunset and moonrise objects load fine. For now my fix is this:
at least that stops my page from crashing.
Thanks.
PS love the script by the way :)