diff --git a/lib/Travelynx/Model/Journeys.pm b/lib/Travelynx/Model/Journeys.pm index bf8c0131504952dbdac7a21e8ae71b726c1d6ae3..01e904a70711beec9acde5f5eaf9ecb52defe025 100755 --- a/lib/Travelynx/Model/Journeys.pm +++ b/lib/Travelynx/Model/Journeys.pm @@ -626,6 +626,13 @@ sub get { $ref->{checkout} = epoch_to_dt( $ref->{checkout_ts} ); $ref->{sched_arrival} = epoch_to_dt( $ref->{sched_arr_ts} ); $ref->{rt_arrival} = epoch_to_dt( $ref->{rt_arr_ts} ); + 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} ); + } + } + } } if ( $opt{verbose} ) { diff --git a/templates/journey.html.ep b/templates/journey.html.ep index 696329f05a92ee34a884e4a16d5acdc2aa641d13..f85efebbb00c9a23308eab6e4d52a60298c24de0 100644 --- a/templates/journey.html.ep +++ b/templates/journey.html.ep @@ -208,6 +208,7 @@ Route + % my $before = 1; % my $within = 0; % my $at_startstop = 0; % for my $station (@{$journey->{route}}) { @@ -220,8 +221,16 @@ % else { % $at_startstop = 0; % } + + % if ($before and $station->[2]{sched_dep}) { + %= $station->[2]{sched_dep}->strftime('%H:%M') + % } + % elsif (not $before and $station->[2]{sched_arr}) { + %= $station->[2]{sched_arr}->strftime('%H:%M') + % } + % if ($at_startstop or $within) { - <%= $station->[0] %> + %= $station->[0] % } % else { <%= $station->[0] %> @@ -229,6 +238,19 @@ % if ($journey->{edited} & 0x0010) { ∗ % } + % if ($within or $at_startstop) { + + % if ($before and $station->[2]{rt_dep} and $station->[2]{dep_delay}) { + %= sprintf('%+d → %s', $station->[2]{dep_delay}, $station->[2]{rt_dep}->strftime('%H:%M')) + % } + % elsif (not $before and $station->[2]{rt_arr} and $station->[2]{arr_delay}) { + %= sprintf('%+d → %s', $station->[2]{arr_delay}, $station->[2]{rt_arr}->strftime('%H:%M')) + % } + + % } + % if ($station->[0] eq $journey->{from_name}) { + % $before = 0; + % }
% }