aboutsummaryrefslogtreecommitdiff
path: root/templates.go
diff options
context:
space:
mode:
Diffstat (limited to 'templates.go')
-rw-r--r--templates.go8
1 files changed, 7 insertions, 1 deletions
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