summaryrefslogtreecommitdiff
path: root/lib/Travelynx
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-03-31 21:21:59 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-03-31 21:21:59 +0200
commitb978ba6bc0c1f429f02990c2439977b2bd4fbe42 (patch)
treedb2c097b3732c6bc6b8670692b002ac2e7b4e452 /lib/Travelynx
parent38e03bcc8815641eb57c9cd6137616938de43d5d (diff)
oops2.6.2
Diffstat (limited to 'lib/Travelynx')
-rw-r--r--lib/Travelynx/Helper/HAFAS.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Travelynx/Helper/HAFAS.pm b/lib/Travelynx/Helper/HAFAS.pm
index 6cbaf11..e0f4706 100644
--- a/lib/Travelynx/Helper/HAFAS.pm
+++ b/lib/Travelynx/Helper/HAFAS.pm
@@ -86,9 +86,10 @@ sub get_departures_p {
my ( $self, %opt ) = @_;
my $when
- = ( $opt{timestamp}->clone
- // DateTime->now( time_zone => 'Europe/Berlin' ) )
- ->subtract( minutes => $opt{lookbehind} );
+ = $opt{timestamp}
+ ? $opt{timestamp}->clone
+ : DateTime->now( time_zone => 'Europe/Berlin' );
+ ->subtract( minutes => $opt{lookbehind} );
return Travel::Status::DE::HAFAS->new_p(
station => $opt{eva},
datetime => $when,