UX: universal date format in digest email
This commit is contained in:
parent
23371b026d
commit
734c272de8
|
@ -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={})
|
||||
|
|
Loading…
Reference in New Issue