From 69f7205453e9e47c6718ebce73d4a5e4473c7946 Mon Sep 17 00:00:00 2001 From: Roman Prokofyev Date: Sat, 7 Apr 2012 02:51:58 +0300 Subject: [PATCH] bugfix for stationboard incorrectly adds 1 day to ALL transports when less than 1 minute passed since first transport departure. --- lib/Transport/API.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Transport/API.php b/lib/Transport/API.php index 96a3a4c..abb6be5 100644 --- a/lib/Transport/API.php +++ b/lib/Transport/API.php @@ -158,7 +158,8 @@ public function getStationBoard(StationBoardQuery $query) // since the stationboard always lists all connections starting from now we just use the date // and wrap it accordingly if time goes over midnight $journeys = array(); - $prevTime = time(); + // subtract one minute because SBB also returns results for one minute in the past + $prevTime = time() - 60; $date = $query->date; if ($result->STBRes->JourneyList->STBJourney) { foreach ($result->STBRes->JourneyList->STBJourney as $journey) {