Zwen2012
Zwen2012

Reputation: 3498

Twig: Translate DateFormat-> Day

I have this in my twig-template

{{ returnDate|date("l, d.m.Y") }}

The ouput is Friday, 08.05.2015. Its it possible to translate the dayname -> "l"? Something like this {{ returnDate|date("l, d.m.Y")|trans }}

Upvotes: 1

Views: 1378

Answers (1)

Alessandro Lai
Alessandro Lai

Reputation: 2274

I had the same problem minutes ago! I pushed a simple, quick & dirty solution:

{{ returnDate | date("l") | trans }}, {{ returnDate | date("d.m.Y") }}

Upvotes: 4

Related Questions