From 03a71c50bce44b21fda36624e4b45edf3bcb6edb Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Wed, 20 Dec 2017 11:07:24 +0100 Subject: Fixed displaying of AQI on train schedule page. --- src/AppBundle/Controller/TrainScheduleController.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/AppBundle/Controller/TrainScheduleController.php') diff --git a/src/AppBundle/Controller/TrainScheduleController.php b/src/AppBundle/Controller/TrainScheduleController.php index d22bbe4..0c2c2eb 100644 --- a/src/AppBundle/Controller/TrainScheduleController.php +++ b/src/AppBundle/Controller/TrainScheduleController.php @@ -58,6 +58,8 @@ class TrainScheduleController extends Controller $datetime = $datesplit[0] . "." . $datesplit[1] . ".20" . $datesplit[2] . " " . $time; $trainTimeStamp = strtotime($datetime) + 3600; + if($trainTimeStamp > time()) break; + foreach ($readings as $reading) { if (abs($reading['TimeStamp'] - $trainTimeStamp) < abs($closest - $trainTimeStamp)) $closest = $reading['TimeStamp']; -- cgit v1.2.3