discourse/app/helpers/embed_helper.rb
2014-03-20 13:25:17 -04:00

18 lines
282 B
Ruby

module EmbedHelper
def embed_post_date(dt)
current = Time.now
if dt >= 1.day.ago
distance_of_time_in_words(dt, current)
else
if dt.year == current.year
dt.strftime("%e %b")
else
dt.strftime("%e %b %Y")
end
end
end
end