diff options
Diffstat (limited to 'plugins/caldav/plugin.go')
-rw-r--r-- | plugins/caldav/plugin.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/caldav/plugin.go b/plugins/caldav/plugin.go index 68de6cf..caeb12a 100644 --- a/plugins/caldav/plugin.go +++ b/plugins/caldav/plugin.go @@ -2,8 +2,10 @@ package alpscaldav import ( "fmt" + "html/template" "net/http" "net/url" + "time" "git.sr.ht/~emersion/alps" ) @@ -57,6 +59,18 @@ func newPlugin(srv *alps.Server) (alps.Plugin, error) { registerRoutes(&p, u) + p.TemplateFuncs(template.FuncMap{ + "formatinputdate": func(t time.Time) string { + return t.Format("2006-01-02") + }, + "ornow": func(t time.Time) time.Time { + if t.IsZero() { + return time.Now() + } + return t + }, + }) + return p.Plugin(), nil } |