summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/HAFAS
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-04-02 16:43:25 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-04-02 16:43:25 +0200
commit4160edfea85c4546b8dda5e15b60dea69e0f4e51 (patch)
tree0fca46fd4e04cd5c92472e476d69ee52d741622e /lib/Travel/Status/DE/HAFAS
parentac3d3d1e6acb3568f3d059f073ae68e1274fdaf7 (diff)
Fix tz offset storage in journey mode
Diffstat (limited to 'lib/Travel/Status/DE/HAFAS')
-rw-r--r--lib/Travel/Status/DE/HAFAS/Journey.pm47
1 files changed, 26 insertions, 21 deletions
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