Added colors to time of day view.

This commit is contained in:
Marvin Blum
2020-09-28 22:02:28 +02:00
committed by Marvin Blum
parent 8accd83042
commit 2057121e33
4 changed files with 24 additions and 6 deletions

View File

@@ -38,9 +38,11 @@ func (cache *Cache) load() {
funcMap := template.FuncMap{
"slug": slug.Make,
"format": func(t time.Time, layout string) string { return t.Format(layout) },
"multiply": func(f, x float64) float64 { return f * x },
"multiply": func(a, b float64) float64 { return a * b },
"divide": func(a, b float64) float64 { return a / b },
"round": func(f float64) string { return fmt.Sprintf("%.2f", f) },
"intRange": intRange,
"float64": func(i int) float64 { return float64(i) },
}
var err error
cache.tpl, err = template.New("").Funcs(funcMap).ParseGlob(templateDir)