aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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))