diff options
author | Daniel Friesel <derf@finalrewind.org> | 2014-01-09 14:51:47 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2014-01-09 14:51:47 +0100 |
commit | 525d395bdd80e26e3957267bf164df8865390329 (patch) | |
tree | 39a008b8704200bbab06ec9ea84514f917925f45 | |
parent | 6961ddc2e357d65d4b4a0e64b54f86ec4a9f5d86 (diff) |
IRIS.pm: Do not return past departures
-rw-r--r-- | lib/Travel/Status/DE/IRIS.pm | 4 |
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; |