From 48375acd7d6581b42b354618ed694a9d1cd25439 Mon Sep 17 00:00:00 2001 From: fusion32 Date: Sat, 18 Oct 2025 20:37:00 -0300 Subject: overall improvements + keep up with querymanager v0.2 --- templates.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'templates.go') diff --git a/templates.go b/templates.go index 1f47782..5281c14 100644 --- a/templates.go +++ b/templates.go @@ -58,7 +58,13 @@ var ( func InitTemplates() bool { var Err error - g_Templates, Err = template.ParseGlob("templates/*.tmpl") + + CustomFuncs := template.FuncMap{ + "FormatTimestamp": FormatTimestamp, + "FormatDurationSince": FormatDurationSince, + } + + g_Templates, Err = template.New("").Funcs(CustomFuncs).ParseGlob("templates/*.tmpl") if Err != nil { g_LogErr.Printf("Failed to parse templates: %v", Err) return false -- cgit v1.2.3