summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-03-20 17:50:14 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-03-20 17:50:14 +0100
commit2e1cf302316d129837a7bb37ec67c77cac8820ef (patch)
tree5fe413313c30a096e471da80e814a63a4c9fd73c
parent0226713c1d1839f2ffac41a1000180c0089afe9d (diff)
Show negative delay as "-X", not "+-X"
-rw-r--r--templates/departures.html.ep2
-rw-r--r--templates/history.html.ep4
-rw-r--r--templates/journey.html.ep4
3 files changed, 5 insertions, 5 deletions
diff --git a/templates/departures.html.ep b/templates/departures.html.ep
index 47c4872..00c1c0e 100644
--- a/templates/departures.html.ep
+++ b/templates/departures.html.ep
@@ -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>
diff --git a/templates/history.html.ep b/templates/history.html.ep
index c2e6f88..af24eed 100644
--- a/templates/history.html.ep
+++ b/templates/history.html.ep
@@ -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) %>)
% }
% }
% }
diff --git a/templates/journey.html.ep b/templates/journey.html.ep
index abd9ba8..e00fdc2 100644
--- a/templates/journey.html.ep
+++ b/templates/journey.html.ep
@@ -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 {