messagerie: better format message dates
This commit is contained in:
parent
fe13871380
commit
211674435e
5 changed files with 57 additions and 1 deletions
|
@ -4,4 +4,10 @@ module CommentaireHelper
|
|||
"from-me"
|
||||
end
|
||||
end
|
||||
|
||||
def commentaire_date(commentaire)
|
||||
is_current_year = (commentaire.created_at.year == Date.current.year)
|
||||
template = is_current_year ? :message_date : :message_date_with_year
|
||||
I18n.l(commentaire.created_at.localtime, format: template)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue