From 6cbd9c67efb39f74b7b9388b71a4ce85439e2464 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 27 Jul 2025 16:28:50 +0200 Subject: Journey: use _dt suffix for with_route_datetime keys --- lib/Travelynx/Model/Journeys.pm | 7 +++---- templates/journey.html.ep | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/Travelynx/Model/Journeys.pm b/lib/Travelynx/Model/Journeys.pm index 77d2076..fd9f9b1 100755 --- a/lib/Travelynx/Model/Journeys.pm +++ b/lib/Travelynx/Model/Journeys.pm @@ -704,7 +704,7 @@ sub get { for my $stop ( @{ $ref->{route} } ) { for my $k (qw(rt_arr rt_dep sched_arr sched_dep)) { if ( $stop->[2]{$k} ) { - $stop->[2]{$k} = epoch_to_dt( $stop->[2]{$k} ); + $stop->[2]{"${k}_dt"} = epoch_to_dt( $stop->[2]{$k} ); } } } @@ -1265,8 +1265,7 @@ sub get_travel_distance { ( ( $_->[1] and $_->[1] == $from_eva or $_->[0] eq $from ) and ( not( defined $_->[2]{sched_dep} or defined $_->[2]{rt_dep} ) - or ( $_->[2]{sched_dep} // $_->[2]{rt_dep} )->epoch - == $from_ts ) + or ( $_->[2]{sched_dep} // $_->[2]{rt_dep} ) == $from_ts ) ) } @{$route_ref}; @@ -1274,7 +1273,7 @@ sub get_travel_distance { ( ( $_->[1] and $_->[1] == $to_eva or $_->[0] eq $to ) and ( not( defined $_->[2]{sched_arr} or defined $_->[2]{rt_arr} ) - or ( $_->[2]{sched_arr} // $_->[2]{rt_arr} )->epoch == $to_ts ) + or ( $_->[2]{sched_arr} // $_->[2]{rt_arr} ) == $to_ts ) ) } @route; diff --git a/templates/journey.html.ep b/templates/journey.html.ep index 2699d4a..09ce159 100644 --- a/templates/journey.html.ep +++ b/templates/journey.html.ep @@ -269,10 +269,10 @@ % } % if ($before and $station->[2]{sched_dep}) { - %= $station->[2]{sched_dep}->strftime('%H:%M') + %= $station->[2]{sched_dep_dt}->strftime('%H:%M') % } % elsif (not $before and $station->[2]{sched_arr}) { - %= $station->[2]{sched_arr}->strftime('%H:%M') + %= $station->[2]{sched_arr_dt}->strftime('%H:%M') % } % if ($at_startstop or $within) { -- cgit v1.2.3