]> git.openstreetmap.org Git - rails.git/commitdiff
Add a friendly_date_ago helper
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 19 Jun 2019 09:59:37 +0000 (11:59 +0200)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 19 Jun 2019 16:04:08 +0000 (18:04 +0200)
Refs #2255

app/helpers/application_helper.rb

index c78c3ea46423227e62db5a69b01633c714f0cb68..0f2c862e6b60a212a21b541c7b76a6c921141cbe 100644 (file)
@@ -49,6 +49,10 @@ module ApplicationHelper
     content_tag(:span, time_ago_in_words(date), :title => l(date, :format => :friendly))
   end
 
     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
   def body_class
     if content_for? :body_class
       content_for :body_class