i have in config timeZone = “Europe/Zurich” and in frontmatter of page: vertretungfrom: 2023-04-17
but this code :
{{ $vervon := dateFormat "Mon. 02. Jan. 2006" .Params.Vertretungfrom }}
<div>{{ (time .Params.Vertretungfrom).Weekday }}</div>
gives : Monday
i expect the german version: Montag
is this a bug, planned behavior or am i doing something wrong?
edit:
languageCode = “de-CH”
bep
2
I’m not sure what to call it, but the time
function returns a time.Time
value from Go’s std library and there’s no localization support there.
Curretnly, you need to use the time.Format
func to get language support:
Note that the above will respect the timezone
setting in your site (or language) config.
oke. tried this
5:{{ time.Format "Monday, Jan 2, 2006" "2015-01-21" }}
according to your advice , should give back “time.Format` returns a localized string for the current language.”
what i get is:

??? interpretation ???
markdown
---
title: About
vertretungfrom: 2023-04-17
---
site configuration
defaultContentLanguage = 'de-ch'
timeZone = 'Europe/Zurich'
template
{{ time.Format "Monday, Jan 2, 2006" .Params.vertretungfrom }}
rendered
Montag, Apr. 17, 2023
languageCode
doesn’t do what you think it does.
1 Like
system
Closed
6
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.