From 666381a582bbae2bc13e9480eb5327ebd5155f8f Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 4 May 2017 23:20:44 -0500 Subject: [PATCH] time_ago_in_words_tagged: handle times set in the future. --- app/helpers/application_helper.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 379c46a38..0d6a57ccf 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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)