summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Helper/HAFAS.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-03-31 14:44:37 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-03-31 14:44:37 +0200
commit970e30202dc1caa3f81f3351b4186d8cde3ddd97 (patch)
tree3dffb1ab8642e5a380dd52fb2e0e379cf1a32c16 /lib/Travelynx/Helper/HAFAS.pm
parent9f0d72b9d14a57479f5f6e6d15314549b47a7c2f (diff)
HAFAS departures: add earlier / later links
Diffstat (limited to 'lib/Travelynx/Helper/HAFAS.pm')
-rw-r--r--lib/Travelynx/Helper/HAFAS.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Travelynx/Helper/HAFAS.pm b/lib/Travelynx/Helper/HAFAS.pm
index 64f2949..6cbaf11 100644
--- a/lib/Travelynx/Helper/HAFAS.pm
+++ b/lib/Travelynx/Helper/HAFAS.pm
@@ -85,7 +85,9 @@ sub get_json_p {
sub get_departures_p {
my ( $self, %opt ) = @_;
- my $when = DateTime->now( time_zone => 'Europe/Berlin' )
+ my $when
+ = ( $opt{timestamp}->clone
+ // DateTime->now( time_zone => 'Europe/Berlin' ) )
->subtract( minutes => $opt{lookbehind} );
return Travel::Status::DE::HAFAS->new_p(
station => $opt{eva},