From 046ab99013958d9016e6e2cbff1a6c2557576315 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 18 Oct 2018 16:26:02 +0200 Subject: history: show departure and arrival times --- templates/history.html.ep | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'templates/history.html.ep') diff --git a/templates/history.html.ep b/templates/history.html.ep index 3c798a4..02d82ab 100644 --- a/templates/history.html.ep +++ b/templates/history.html.ep @@ -6,7 +6,8 @@ Datum Zug Strecke - Dauer + Abfahrt + Ankunft @@ -16,12 +17,16 @@ <%= $travel->{sched_departure}->strftime('%d.%m.%Y') %> <%= $travel->{type} %> <%= $travel->{line} // $travel->{no} %> <%= $travel->{from_name} %> → <%= $travel->{to_name} %> - % if ($travel->{rt_arrival} and $travel->{rt_departure}) { - <%= ($travel->{rt_arrival}->epoch - $travel->{rt_departure}->epoch) / 60 %> min + <%= $travel->{rt_departure}->strftime('%H:%M') %> + % if ($travel->{sched_departure} != $travel->{rt_departure}) { + (+<%= ($travel->{rt_departure}->epoch - $travel->{sched_departure}->epoch) / 60 %>) % } - % else { - ? + + <%= $travel->{rt_arrival}->strftime('%H:%M') %> + % if ($travel->{sched_arrival} != $travel->{rt_arrival}) { + (+<%= ($travel->{rt_arrival}->epoch - $travel->{sched_arrival}->epoch) / 60 %>) % } + % } % } -- cgit v1.2.3