summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Helper/HAFAS.pm
diff options
context:
space:
mode:
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},