From 468638351277d87ae537c9460bdf45b2aa5c6b77 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Fri, 13 Nov 2015 21:45:52 +0100 Subject: [PATCH] UX: Use localized date format in digest email --- app/mailers/user_notifications.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rb index 030c5caa7aa..e48a604f8c2 100644 --- a/app/mailers/user_notifications.rb +++ b/app/mailers/user_notifications.rb @@ -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