[FIX] correct remaining time calculation if time is after midnoght

This commit is contained in:
Jannik Beyerstedt 2017-08-03 00:07:14 +02:00
parent b0a675ab3d
commit e31b31e6f7

View file

@ -82,7 +82,7 @@ class LightStatus {
$this->changeTime = (int)(($stopTime - $currentTime) / 60); $this->changeTime = (int)(($stopTime - $currentTime) / 60);
$this->waitTime = 1; $this->waitTime = 1;
return true; return true;
} elseif ($currentTime < $startTime || ($startTime+(24*60*60) - $currentTime) < (12*60*60) ) { } elseif ( ($startTime - $currentTime) < (12*60*60) || ($startTime+(24*60*60) - $currentTime) < (12*60*60) ) {
// right before the next time interval // right before the next time interval
$this->state = false; $this->state = false;
if ($currentTime < $startTime) { if ($currentTime < $startTime) {