mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-29 08:09:55 -04:00
UX: Use localized date format in digest email
This commit is contained in:
parent
43614439e6
commit
4686383512
1 changed files with 3 additions and 4 deletions
|
@ -42,11 +42,10 @@ class UserNotifications < ActionMailer::Base
|
|||
end
|
||||
|
||||
def short_date(dt)
|
||||
current = Time.now
|
||||
if dt.year == current.year
|
||||
dt.strftime("%B #{dt.day.ordinalize}")
|
||||
if dt.year == Time.now.year
|
||||
I18n.l(dt, format: :short_no_year)
|
||||
else
|
||||
dt.strftime("%B #{dt.day.ordinalize}, %Y")
|
||||
I18n.l(dt, format: :short)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue