diff options
author | marcinzelent <zelent.marcin@gmail.com> | 2017-12-20 11:13:18 +0100 |
---|---|---|
committer | marcinzelent <zelent.marcin@gmail.com> | 2017-12-20 11:13:18 +0100 |
commit | d8e3c19acc0ee7d9d110db5d1c692530097b739f (patch) | |
tree | a27b721f00cbc807ea4a5cb09687fdcbdc84c5a0 /src | |
parent | 03a71c50bce44b21fda36624e4b45edf3bcb6edb (diff) |
Set AQI to 0 for trains in the future.
Diffstat (limited to 'src')
-rw-r--r-- | src/AppBundle/Controller/TrainScheduleController.php | 6 |
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)) |