summaryrefslogtreecommitdiff
path: root/srv/src/api/tpl.go
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2022-05-20 10:13:46 -0600
committerBrian Picciano <mediocregopher@gmail.com>2022-05-20 10:13:46 -0600
commit75044eef0331bb9448da813288aafc6735ce7c22 (patch)
treea2fb34b0811cb524d87016e968255d2b6771d06d /srv/src/api/tpl.go
parent0bc0204f0b718464d7ea9d97d6d03ee81f1953c6 (diff)
Implement edit post page
Diffstat (limited to 'srv/src/api/tpl.go')
-rw-r--r--srv/src/api/tpl.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/srv/src/api/tpl.go b/srv/src/api/tpl.go
index 5e33bea..9818b10 100644
--- a/srv/src/api/tpl.go
+++ b/srv/src/api/tpl.go
@@ -8,6 +8,7 @@ import (
"net/http"
"path/filepath"
"strings"
+ "time"
"github.com/mediocregopher/blog.mediocregopher.com/srv/api/apiutil"
)
@@ -50,6 +51,9 @@ func (a *api) mustParseTpl(name string) *template.Template {
path := filepath.Join("posts", id)
return blogURL(path)
},
+ "DateTimeFormat": func(t time.Time) string {
+ return t.Format("2006-01-02")
+ },
})
tpl = template.Must(tpl.Parse(mustReadTplFile(name)))