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
1 changed files with 3 additions and 4 deletions

View File

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