mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 08:03:40 +08:00
Merge pull request #3898 from gschlager/i18n-patch6
UX: Use localized date format in digest email
This commit is contained in:
commit
a0834d17b2
|
@ -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…
Reference in New Issue
Block a user