2014-03-20 13:25:17 -04:00
|
|
|
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
|
2014-03-23 15:22:02 -04:00
|
|
|
dt.strftime("%b '%y")
|
2014-03-20 13:25:17 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|