Use time.zone functions instead of server time functions

(Time.zone.today vs Date.today)
This commit is contained in:
maatinito 2019-11-25 13:39:42 +00:00 committed by Pierre de La Morinerie
parent 14bc2b99b9
commit 9de9a1fd71
7 changed files with 10 additions and 10 deletions

View file

@ -18,7 +18,7 @@ module CommentaireHelper
end
def commentaire_date(commentaire)
is_current_year = (commentaire.created_at.year == Date.current.year)
is_current_year = (commentaire.created_at.year == Time.zone.today.year)
template = is_current_year ? :message_date : :message_date_with_year
I18n.l(commentaire.created_at, format: template)
end