Merge pull request #3898 from gschlager/i18n-patch6

UX: Use localized date format in digest email
This commit is contained in:
Régis Hanol 2015-11-16 11:26:20 +01:00
commit a0834d17b2

View File

@ -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