Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date is not localized #124

Open
matheusgomesms opened this issue Feb 19, 2023 · 2 comments
Open

Date is not localized #124

matheusgomesms opened this issue Feb 19, 2023 · 2 comments
Labels
enhancement New feature or request news page News Page of the website

Comments

@matheusgomesms
Copy link
Contributor

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
Copy link
Member

Tera's date doesn't localize dates yet :( https://tera.netlify.app/docs/#date
Keats/tera#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
Copy link
Member

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

@oleg-rswll oleg-rswll added enhancement New feature or request news page News Page of the website labels Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request news page News Page of the website
Projects
None yet
Development

No branches or pull requests

3 participants