diff --git a/appview/pages/funcmap.go b/appview/pages/funcmap.go index 73caa97a..c0d22bc5 100644 --- a/appview/pages/funcmap.go +++ b/appview/pages/funcmap.go @@ -195,6 +195,9 @@ func (p *Pages) funcMap() template.FuncMap { {D: math.MaxInt64, Format: "a long while %s", DivBy: 1}, }) }, + "shortTimeFmt": func(t time.Time) string { + return t.Format("Jan 2, 2006") + }, "longTimeFmt": func(t time.Time) string { return t.Format("Jan 2, 2006, 3:04 PM MST") }, diff --git a/blog/templates/index.html b/blog/templates/index.html index a41c556f..72ffe1cb 100644 --- a/blog/templates/index.html +++ b/blog/templates/index.html @@ -31,7 +31,7 @@
{{ $date := .Post.ParsedDate }} - {{ $date.Format "02 Jan, 2006" }} + {{ $date | shortTimeFmt }}
{{ $dateStr := index .Meta "date" }} {{ $date := parsedate $dateStr }} - {{ $date.Format "02 Jan, 2006" }} + {{ $date.Format | shortTimeFmt }} ·