aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/AppBundle/Controller')
-rw-r--r--src/AppBundle/Controller/TrainScheduleController.php2
1 files changed, 2 insertions, 0 deletions
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'];