From 1344f12a7bc4718fb327968c6903e2ccd5675508 Mon Sep 17 00:00:00 2001 From: Alex Legler Date: Wed, 28 Jan 2015 19:15:33 +0100 Subject: Fix maintenance start times --- views/notice.erb | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/views/notice.erb b/views/notice.erb index 9e2e8bf..b7c0ddd 100644 --- a/views/notice.erb +++ b/views/notice.erb @@ -12,16 +12,15 @@
<%= date_format notice['created_at'] %>
<% if notice.has_key? 'starts_at' %> -
- <% diff = ((DateTime.now - notice['starts_at']) * 24 * 60 * 60).to_i %> + <%- diff = ((DateTime.now - notice['starts_at']) * 24 * 60 * 60).to_i %> +
+ title="Maintenance starts in <%= humanize(-diff) %>" + <% else %> + title="Maintenance started <%= humanize(diff) %> ago" + <% end %>> -
<%= date_format notice['starts_at'] %>
- <% if diff < 0 %> - (in <%= humanize(-diff) %>) - <% else %> - (<%= humanize(diff) %> ago) - <% end %> -
+
<%= date_format notice['starts_at'] %>
<% else %>
-- cgit v1.2.3-65-gdbad