summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-12-09 23:31:58 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2023-12-09 23:31:58 +0100
commit9e247ba5a410c3a5bf4a43576c820ef6e5838649 (patch)
tree63d8775c490e6084a1308fd71e5904586814e66e /lib
parente273c5db753e9d792f7e002f7baa7b0a33e09dd6 (diff)
HAFAS: Add arrival option
Diffstat (limited to 'lib')
-rw-r--r--lib/Travel/Routing/DE/HAFAS.pm13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Travel/Routing/DE/HAFAS.pm b/lib/Travel/Routing/DE/HAFAS.pm
index 3c768be..aa7e8b7 100644
--- a/lib/Travel/Routing/DE/HAFAS.pm
+++ b/lib/Travel/Routing/DE/HAFAS.pm
@@ -216,8 +216,9 @@ sub new {
my $req;
- my $date = ( $conf{datetime} // $now )->strftime('%Y%m%d');
- my $time = ( $conf{datetime} // $now )->strftime('%H%M%S');
+ my $date = ( $conf{datetime} // $now )->strftime('%Y%m%d');
+ my $time = ( $conf{datetime} // $now )->strftime('%H%M%S');
+ my $outFrwd = $conf{arrival} ? \0 : undef;
my ( $from_lid, $to_lid );
if ( $self->{from_stop} =~ m{ ^ [0-9]+ $ }x ) {
@@ -243,7 +244,7 @@ sub new {
numF => 6,
maxChg => undef,
minChgTime => undef,
- outFrwd => undef,
+ outFrwd => $outFrwd,
viaLocL => undef,
trfReq => {
cType => 'PK',
@@ -692,6 +693,12 @@ must be specified either by name or by EVA ID (e.g. 8000080 for Dortmund Hbf).
Destination stop, e.g. "Essen HBf" or "Alfredusbad, Essen (Ruhr)". The stop
must be specified either by name or by EVA ID (e.g. 8000080 for Dortmund Hbf).
+=item B<arrival> => I<bool>
+
+If true: request connections that arrive at the destination before the
+specified time. If false (default): request connections that leave at the
+origin after the specified time.
+
=item B<cache> => I<Cache::File object>
Store HAFAS replies in the provided cache object. This module works with