TransWikia.com

How do I translate the weekday in a date?

Drupal Answers Asked by David Brugmans on October 26, 2021

I created a view from a JSON file; the dates in that file follow the 2020-07-28 20:00 format. I do a rewrite of the date to <span>{{ value_1|date("l d/m/Y") }}</span> and I get Tuesday 28/07/2020, but I want to get the weekday in Dutch.

Is there code for this?

enter image description here

One Answer

Use the below example as a temporal solution, I'm not sure if this is the proper way. The approach is to split the problem.

{{ value_1|date("l")|t }} {{ value_1|date("d/m/Y") }}

Regarding the next link, the proper use of translation on twig is using "t" filter. How do I translate strings in Twig templates?

Answered by Diego Restrepo on October 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP