fix user date format and create helper

closes #38
This commit is contained in:
sentriz
2020-02-23 04:08:21 +00:00
parent 3ced8221db
commit 554a74cba5
3 changed files with 137 additions and 134 deletions

View File

@@ -80,7 +80,10 @@ func New(base *ctrlbase.Controller) *Controller {
New("layout").
Funcs(sprig.FuncMap()).
Funcs(template.FuncMap{
"humanDate": humanize.Time,
"date": func(in time.Time) string {
return strings.ToLower(in.Format("Jan 02, 2006"))
},
"dateHuman": humanize.Time,
"path": base.Path,
})
tmplBase = extendFromPaths(tmplBase, prefixPartials)