universal date format in digest email

This commit is contained in:
Arpit Jalan 2016-01-28 23:11:20 +05:30
parent 617dc42cd9
commit 90d41a994a

View File

@ -44,9 +44,9 @@ class UserNotifications < ActionMailer::Base
def short_date(dt)
if dt.year == Time.now.year
I18n.l(dt, format: :short_no_year)
dt.strftime("%B #{dt.day.ordinalize}")
else
I18n.l(dt, format: :short)
dt.strftime("%B #{dt.day.ordinalize}, %Y")
end
end