From 525d395bdd80e26e3957267bf164df8865390329 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 9 Jan 2014 14:51:47 +0100 Subject: IRIS.pm: Do not return past departures --- lib/Travel/Status/DE/IRIS.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/Travel/Status/DE') 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 @@ -57,6 +57,10 @@ sub new { $self->get_realtime; + @{ $self->{results} } + = grep { ( $_->departure // $_->arrival ) >= $self->{datetime} } + @{ $self->{results} }; + @{ $self->{results} } = sort { $a->{datetime} <=> $b->{datetime} } @{ $self->{results} }; -- cgit v1.2.3