From 4160edfea85c4546b8dda5e15b60dea69e0f4e51 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Tue, 2 Apr 2024 16:43:25 +0200 Subject: Fix tz offset storage in journey mode --- lib/Travel/Status/DE/HAFAS/Journey.pm | 47 +++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 21 deletions(-) (limited to 'lib/Travel/Status/DE') diff --git a/lib/Travel/Status/DE/HAFAS/Journey.pm b/lib/Travel/Status/DE/HAFAS/Journey.pm index ed66cdd..f8b0f3f 100644 --- a/lib/Travel/Status/DE/HAFAS/Journey.pm +++ b/lib/Travel/Status/DE/HAFAS/Journey.pm @@ -174,28 +174,33 @@ sub new { // $journey->{stbStop}{dPltfR}{txt}; $ref->{platform} = $ref->{rt_platform} // $ref->{sched_platform}; - my $time_s - = $journey->{stbStop}{ $hafas->{arrivals} ? 'aTimeS' : 'dTimeS' }; - my $time_r - = $journey->{stbStop}{ $hafas->{arrivals} ? 'aTimeR' : 'dTimeR' }; - - for my $timestr ( $time_s, $time_r ) { - if ( not defined $timestr ) { - next; - } - - $timestr = Travel::Status::DE::HAFAS::Stop::handle_day_change( - $journey, - input => $timestr, - date => $date, - strp_obj => $hafas->{strptime_obj}, - ref => $datetime_ref, - ); - - } + my $datetime_s = Travel::Status::DE::HAFAS::Stop::handle_day_change( + $ref, + input => + $journey->{stbStop}{ $hafas->{arrivals} ? 'aTimeS' : 'dTimeS' }, + offset => $journey->{stbStop}{ + $hafas->{arrivals} + ? 'aTZOffset' + : 'dTZOffset' + }, + date => $date, + strp_obj => $hafas->{strptime_obj}, + ref => $datetime_ref, + ); - my $datetime_s = $time_s; - my $datetime_r = $time_r; + my $datetime_r = Travel::Status::DE::HAFAS::Stop::handle_day_change( + $ref, + input => + $journey->{stbStop}{ $hafas->{arrivals} ? 'aTimeR' : 'dTimeR' }, + offset => $journey->{stbStop}{ + $hafas->{arrivals} + ? 'aTZOffset' + : 'dTZOffset' + }, + date => $date, + strp_obj => $hafas->{strptime_obj}, + ref => $datetime_ref, + ); my $delay = $datetime_r -- cgit v1.2.3