user987456321 user987456321 - 1 year ago 58
PHP Question

Twig : how to translate a date filter variable?

I have a twig template where a

{{ startdate|date('d-m-Y')}}
. I want it to display the month in french, how can I do it ? It is a Symfony application.


Answer Source

I think you need to use The Intl Extension

And it would be something like that :

{{ startdate|localizeddate('none', 'none', null, null, 'EEEE d MMMM Y') }}

return mardi 9 août 2016