From d8e3c19acc0ee7d9d110db5d1c692530097b739f Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Wed, 20 Dec 2017 11:13:18 +0100 Subject: Set AQI to 0 for trains in the future. --- src/AppBundle/Controller/TrainScheduleController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/AppBundle/Controller/TrainScheduleController.php b/src/AppBundle/Controller/TrainScheduleController.php index 0c2c2eb..1f828f4 100644 --- a/src/AppBundle/Controller/TrainScheduleController.php +++ b/src/AppBundle/Controller/TrainScheduleController.php @@ -58,7 +58,11 @@ class TrainScheduleController extends Controller $datetime = $datesplit[0] . "." . $datesplit[1] . ".20" . $datesplit[2] . " " . $time; $trainTimeStamp = strtotime($datetime) + 3600; - if($trainTimeStamp > time()) break; + if($trainTimeStamp > time()) + { + $trains[$i]['direction'] = 0; + break; + } foreach ($readings as $reading) { if (abs($reading['TimeStamp'] - $trainTimeStamp) < abs($closest - $trainTimeStamp)) -- cgit v1.2.3