1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Add more unit tests for template functions

This commit is contained in:
Frédéric Guillot 2018-09-20 19:45:56 -07:00
parent d79bab2997
commit f244df6293
5 changed files with 129 additions and 122 deletions

View file

@ -44,6 +44,8 @@ func (e *Engine) Render(name, language string, data interface{}) []byte {
}
lang := e.translator.GetLanguage(language)
// Functions that need to be declared at runtime.
tpl.Funcs(template.FuncMap{
"elapsed": func(timezone string, t time.Time) string {
return elapsedTime(lang, timezone, t)