UX: universal date format in digest email

This commit is contained in:
Arpit Jalan 2015-10-28 22:15:07 +05:30
parent 23371b026d
commit 734c272de8
1 changed files with 6 additions and 1 deletions

View File

@ -42,7 +42,12 @@ class UserNotifications < ActionMailer::Base
end
def short_date(dt)
I18n.l(dt, format: :short)
current = Time.now
if dt.year == current.year
dt.strftime("%B #{dt.day.ordinalize}")
else
dt.strftime("%B #{dt.day.ordinalize}, %Y")
end
end
def digest(user, opts={})