hous
hous

Reputation: 2679

How to add some text between date and hour with twig localizeddate extension

This is my code

{{ commentaire.dateCommentaire|localizeddate('medium', 'medium') }}

and this is the output

12 MARS 2016 20:35:21

I'd like to add a text between date and hour to be like this

12 MARS 2016 à 20:35:21

How can I do this ?

Upvotes: 3

Views: 174

Answers (1)

Paweł Mikołajczuk
Paweł Mikołajczuk

Reputation: 3812

You need to use format option:

format: Optional pattern to use when formatting or parsing. Possible patterns are documented in the ICU user guide.

{{ commentaire.dateCommentaire|localizeddate('medium', 'medium', format='dd MMM yyyy à HH:mm:ss') }}

Upvotes: 3

Related Questions