summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,