fix account tmpls breaking due to time elapsed changes

This commit is contained in:
Azareal 2020-03-22 12:20:13 +10:00
parent 75ed0cd5f2
commit f074b5578c
1 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import (
p "github.com/Azareal/Gosora/common/phrases"
tmpl "github.com/Azareal/Gosora/common/templates"
qgen "github.com/Azareal/Gosora/query_gen"
"github.com/Azareal/Gosora/uutils"
)
var Ctemplates []string // TODO: Use this to filter out top level templates we don't need
@ -743,7 +744,8 @@ func initDefaultTmplFuncMap() {
}
fmap["elapsed"] = func(startedAtInt interface{}) interface{} {
return time.Since(startedAtInt.(time.Time)).String()
//return time.Since(startedAtInt.(time.Time)).String()
return time.Duration(uutils.Nanotime() - startedAtInt.(int64)).String()
}
fmap["lang"] = func(phraseNameInt interface{}) interface{} {