news updates: use relative time instead of date.

Use relative time on site updates to show when a site update was posted
("5m ago"), instead of the date ("Oct 1").
This commit is contained in:
evazion
2021-10-01 05:12:40 -05:00
parent 1335639298
commit 6c7fbb96b3

View File

@@ -2,7 +2,7 @@
<div id="news-updates" data-id="<%= NewsUpdate.recent.first.try(:id) %>" style="display: none;">
<ul>
<% NewsUpdate.recent.each do |news_update| %>
<li><%= news_update.created_at.strftime("%b %d") %>: <%= news_update.message.html_safe %></li>
<li><%= time_ago_in_words_tagged(news_update.created_at, compact: true) %> ago: <%= news_update.message.html_safe %></li>
<% end %>
</ul>