ch14.2
This commit is contained in:
@@ -23,7 +23,10 @@ type templateData struct {
|
||||
}
|
||||
|
||||
func humanDate(t time.Time) string {
|
||||
return t.Format("02 Jan 2006 at 15:04")
|
||||
if t.IsZero() {
|
||||
return ""
|
||||
}
|
||||
return t.UTC().Format("02 Jan 2006 at 15:04")
|
||||
}
|
||||
|
||||
var functions = template.FuncMap{
|
||||
|
||||
Reference in New Issue
Block a user