discourse/lib/age_words.rb

13 lines
200 B
Ruby
Raw Normal View History

2013-02-06 03:16:51 +08:00
module AgeWords
def self.age_words(secs)
2016-04-01 05:33:25 +08:00
if secs.blank?
"—"
else
now = Time.now
FreedomPatches::Rails4.distance_of_time_in_words(now, now + secs)
end
2013-02-06 03:16:51 +08:00
end
end