time_ago_in_words_tagged: handle times set in the future.

This commit is contained in:
evazion
2017-05-04 23:20:44 -05:00
parent b6e1958917
commit 666381a582

View File

@@ -90,7 +90,11 @@ module ApplicationHelper
end
def time_ago_in_words_tagged(time)
raw time_tag(time_ago_in_words(time) + " ago", time)
if time.past?
raw time_tag(time_ago_in_words(time) + " ago", time)
else
raw time_tag("in " + distance_of_time_in_words(Time.now, time), time)
end
end
def compact_time(time)