aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcinzelent <zelent.marcin@gmail.com>2017-12-20 11:13:18 +0100
committermarcinzelent <zelent.marcin@gmail.com>2017-12-20 11:13:18 +0100
commitd8e3c19acc0ee7d9d110db5d1c692530097b739f (patch)
treea27b721f00cbc807ea4a5cb09687fdcbdc84c5a0 /src/AppBundle/Controller/TrainScheduleController.php
parent03a71c50bce44b21fda36624e4b45edf3bcb6edb (diff)
Set AQI to 0 for trains in the future.
Diffstat (limited to 'src/AppBundle/Controller/TrainScheduleController.php')
-rw-r--r--src/AppBundle/Controller/TrainScheduleController.php6
1 files changed, 5 insertions, 1 deletions
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))