From f284d57c6236327b50c8d4a2ac0545105d1d03cc Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 19 Jun 2019 11:59:37 +0200 Subject: [PATCH] Add a friendly_date_ago helper Refs #2255 --- app/helpers/application_helper.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c78c3ea46..0f2c862e6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -49,6 +49,10 @@ module ApplicationHelper content_tag(:span, time_ago_in_words(date), :title => l(date, :format => :friendly)) end + def friendly_date_ago(date) + content_tag(:span, time_ago_in_words(date, :scope => :'datetime.distance_in_words_ago'), :title => l(date, :format => :friendly)) + end + def body_class if content_for? :body_class content_for :body_class -- 2.39.5