mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-14 00:50:14 -04:00
UX: universal date format in digest email
This commit is contained in:
parent
23371b026d
commit
734c272de8
1 changed files with 6 additions and 1 deletions
|
@ -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 a new issue