From b978ba6bc0c1f429f02990c2439977b2bd4fbe42 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 31 Mar 2024 21:21:59 +0200 Subject: oops --- lib/Travelynx/Helper/HAFAS.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/Travelynx') 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, -- cgit v1.2.3