Open matheusgomesms opened 1 year ago
Tera's date doesn't localize dates yet :( https://tera.netlify.app/docs/#date https://github.com/Keats/tera/issues/612
A patch can be done to localize it in the browser using JavaScript, or maybe some other hacky solution at the generation time.
This approach can be tried:
cat templates/localized_date.html
{% set dateFormat = trans(key="date-format", lang=lang) %}
{% set dateLocale = trans(key="date-locale", lang=lang) %}
{{ resource.date | date(format=dateFormat, locale=dateLocale) }}
Minor improvement: on News section, the date is not localized. No matter the language, it is displayed in English language and format (February 14, 2023, for example).