Rails 3 - time_ago_in_words says “ABOUT 2 hours ago”

后端 未结 3 1844
忘掉有多难
忘掉有多难 2020-12-23 20:47

Code:

<%=\"#{time_ago_in_words(comment.created_at)} ago \"%>

What i\'d like is for it not to have \"ABOUT\" in front of the 2 hours a

3条回答
  •  轮回少年
    2020-12-23 21:44

    You can use my dotiw gem/plugin for that. It adds a couple of additional options and has greater precision than the one Rails offers.

    distance_of_time_in_words(time1, time2, :only => [:days, :hours, :minutes])
    

提交回复
热议问题