summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/IRIS.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-01-09 14:51:47 +0100
committerDaniel Friesel <derf@finalrewind.org>2014-01-09 14:51:47 +0100
commit525d395bdd80e26e3957267bf164df8865390329 (patch)
tree39a008b8704200bbab06ec9ea84514f917925f45 /lib/Travel/Status/DE/IRIS.pm
parent6961ddc2e357d65d4b4a0e64b54f86ec4a9f5d86 (diff)
IRIS.pm: Do not return past departures
Diffstat (limited to 'lib/Travel/Status/DE/IRIS.pm')
-rw-r--r--lib/Travel/Status/DE/IRIS.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm
index e6bccaf..02299fe 100644
--- a/lib/Travel/Status/DE/IRIS.pm
+++ b/lib/Travel/Status/DE/IRIS.pm
@@ -58,6 +58,10 @@ sub new {
$self->get_realtime;
@{ $self->{results} }
+ = grep { ( $_->departure // $_->arrival ) >= $self->{datetime} }
+ @{ $self->{results} };
+
+ @{ $self->{results} }
= sort { $a->{datetime} <=> $b->{datetime} } @{ $self->{results} };
return $self;