This commit is contained in:
pavel 2026-04-08 21:54:57 +02:00
commit 561ed63ac7
5 changed files with 18 additions and 3 deletions

View file

@ -25,7 +25,11 @@ type Renderer struct {
templates *template.Template
}
func NewRenderer() (*Renderer, error) {
func NewRenderer(location *time.Location) (*Renderer, error) {
if location == nil {
location = time.UTC
}
funcs := template.FuncMap{
"money": platform.FormatCZK,
"dt": func(t time.Time) string {
@ -33,7 +37,7 @@ func NewRenderer() (*Renderer, error) {
return ""
}
return t.Format("02. 01. 2006 15:04")
return t.In(location).Format("02. 01. 2006 15:04")
},
}