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
|
end
|
||||||
|
|
||||||
def short_date(dt)
|
def short_date(dt)
|
||||||
current = Time.now
|
if dt.year == Time.now.year
|
||||||
if dt.year == current.year
|
I18n.l(dt, format: :short_no_year)
|
||||||
dt.strftime("%B #{dt.day.ordinalize}")
|
|
||||||
else
|
else
|
||||||
dt.strftime("%B #{dt.day.ordinalize}, %Y")
|
I18n.l(dt, format: :short)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue