diff options
Diffstat (limited to 'lib/templates')
-rw-r--r-- | lib/templates/template.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/templates/template.go b/lib/templates/template.go index f2765e87..9df594eb 100644 --- a/lib/templates/template.go +++ b/lib/templates/template.go @@ -156,11 +156,16 @@ func cmd(cmd, text string) string { return out.String() } +func toLocal(t time.Time) time.Time { + return time.Time.In(t, time.Local) +} + var templateFuncs = template.FuncMap{ "quote": quote, "wrapText": wrapText, "wrap": wrap, "dateFormat": time.Time.Format, + "toLocal": toLocal, "exec": cmd, } |