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
|
|
|
|
|
2018-05-09 13:24:44 -04:00
|
|
|
def get_html(post)
|
|
|
|
raw PrettyText.format_for_email(post.cooked, post)
|
2015-05-01 09:04:45 -04:00
|
|
|
end
|
2014-03-20 13:25:17 -04:00
|
|
|
end
|