Show negative delay as "-X", not "+-X"

This commit is contained in:
Daniel Friesel 2019-03-20 17:50:14 +01:00
parent 0226713c1d
commit 2e1cf30231
3 changed files with 5 additions and 5 deletions

View file

@ -71,7 +71,7 @@
</td>
<td class="<%= $td_class %>"><%= $result->departure->strftime('%H:%M') %>
% if ($result->departure_delay) {
(+<%= $result->departure_delay %>)
(<%= sprintf('%+d', $result->departure_delay) %>)
% }
</td>
</tr>

View file

@ -47,7 +47,7 @@
% else {
<%= $travel->{rt_departure}->strftime('%H:%M') %>
% if ($travel->{sched_departure} != $travel->{rt_departure}) {
(+<%= ($travel->{rt_departure}->epoch - $travel->{sched_departure}->epoch) / 60 %>)
(<%= sprintf('%+d', ($travel->{rt_departure}->epoch - $travel->{sched_departure}->epoch) / 60) %>)
% }
% }
</td>
@ -61,7 +61,7 @@
% } else {
%= $travel->{rt_arrival}->strftime('%H:%M');
% if ($travel->{sched_arrival} != $travel->{rt_arrival}) {
(+<%= ($travel->{rt_arrival}->epoch - $travel->{sched_arrival}->epoch) / 60 %>)
(<%= sprintf('%+d', ($travel->{rt_arrival}->epoch - $travel->{sched_arrival}->epoch) / 60) %>)
% }
% }
% }

View file

@ -45,7 +45,7 @@
% }
% elsif ($journey->{rt_departure} != $journey->{sched_departure}) {
%= $journey->{rt_departure}->strftime('%H:%M');
(+<%= ($journey->{rt_departure}->epoch - $journey->{sched_departure}->epoch) / 60 %>,
(<%= sprintf('%+d', ($journey->{rt_departure}->epoch - $journey->{sched_departure}->epoch) / 60) %>,
Plan: <%= $journey->{sched_departure}->strftime('%H:%M'); %>)
% }
% else {
@ -67,7 +67,7 @@
% }
% elsif ($journey->{rt_arrival} != $journey->{sched_arrival}) {
%= $journey->{rt_arrival}->strftime('%H:%M');
(+<%= ($journey->{rt_arrival}->epoch - $journey->{sched_arrival}->epoch) / 60 %>,
(<%= sprintf('%+d', ($journey->{rt_arrival}->epoch - $journey->{sched_arrival}->epoch) / 60) %>,
Plan: <%= $journey->{sched_arrival}->strftime('%H:%M'); %>)
% }
% else {