diff options
| author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-07-27 16:28:50 +0200 | 
|---|---|---|
| committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-07-27 16:28:50 +0200 | 
| commit | 6cbd9c67efb39f74b7b9388b71a4ce85439e2464 (patch) | |
| tree | 67c9756f5a2165fbdcc1f1bb0fcca173f80a9ee2 | |
| parent | 15355cc17edbd1c83698288f3756e8648adb09e8 (diff) | |
Journey: use _dt suffix for with_route_datetime keys
| -rwxr-xr-x | lib/Travelynx/Model/Journeys.pm | 7 | ||||
| -rw-r--r-- | 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 @@  							% }  							<span style="color: #808080;">  								% 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')  								% }  							</span>  							% if ($at_startstop or $within) {  | 
