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:
parent
d79bab2997
commit
f244df6293
5 changed files with 129 additions and 122 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue