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