-
-
Notifications
You must be signed in to change notification settings - Fork 219
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 localization issue with .Date.Format #273
Comments
Additionally: |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Date localization with .Date.Format doesn't translate e.g. names of Weekdays or Months in diffrent languages well. E.g. if you're trying to use a german datetime format, die Weekdays and Monthnames will stay in english, when using
{{ .Date.Format .Site.Params.dateFormat }}
Reproduction steps
set in
config.yml
languageCode: de
defaultContentLanguage: de
dateFormat: Mon, 02.01.2006 15:04:05
shortDateFormat: 02.01. 15:04
look at die date of an incident in web view -> english names.
Solution
Use
{{ dateFormat .Site.Params.dateFormat .Params.date }}
instead.dateFormat
is an alias fortime.Format
(note: time)it handles timeformats and translations correctly.
layouts/issues/issue.html
uses .Date.Format in line 15. in line 55 & 74 dateFormat is used.-> Change line 15 to
{{ dateFormat .Site.Params.dateFormat .Params.date }}
layouts/issues/single.html
-> change line 24 to{{ dateFormat .Site.Params.dateFormat .Lastmod }}
The text was updated successfully, but these errors were encountered: