From e31b31e6f74ea2d12388d302cdff69dc4131fc6e Mon Sep 17 00:00:00 2001 From: Jannik Beyerstedt Date: Thu, 3 Aug 2017 00:07:14 +0200 Subject: [PATCH] [FIX] correct remaining time calculation if time is after midnoght --- functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.php b/functions.php index ffcfda4..fe20ee3 100644 --- a/functions.php +++ b/functions.php @@ -82,7 +82,7 @@ class LightStatus { $this->changeTime = (int)(($stopTime - $currentTime) / 60); $this->waitTime = 1; 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 $this->state = false; if ($currentTime < $startTime) {