Date is not localized #124

Open
opened 2023-02-19 21:50:53 +00:00 by matheusgomesms · 2 comments
matheusgomesms commented 2023-02-19 21:50:53 +00:00 (Migrated from github.com)

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).

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).
biodranik commented 2023-02-19 23:34:04 +00:00 (Migrated from github.com)

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.

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.
biodranik commented 2023-09-17 06:08:56 +00:00 (Migrated from github.com)

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) }}
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) }} ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: organicmaps/website#124
No description provided.