Remove underscore functions

This commit is contained in:
binwiederhier
2025-07-19 22:41:53 +02:00
parent 8b4834929d
commit 892e82ceb8
2 changed files with 15 additions and 18 deletions

View File

@@ -52,7 +52,7 @@ func TestDateInZone(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
tpl := `{{ date_in_zone "02 Jan 06 15:04 -0700" .Time "UTC" }}` tpl := `{{ dateInZone "02 Jan 06 15:04 -0700" .Time "UTC" }}`
// Test time.Time input // Test time.Time input
if err = runtv(tpl, "13 Jun 19 20:39 +0000", map[string]any{"Time": tm}); err != nil { if err = runtv(tpl, "13 Jun 19 20:39 +0000", map[string]any{"Time": tm}); err != nil {
@@ -86,7 +86,7 @@ func TestDateInZone(t *testing.T) {
} }
// Test case of invalid timezone // Test case of invalid timezone
tpl = `{{ date_in_zone "02 Jan 06 15:04 -0700" .Time "foobar" }}` tpl = `{{ dateInZone "02 Jan 06 15:04 -0700" .Time "foobar" }}`
if err = runtv(tpl, "13 Jun 19 20:39 +0000", map[string]any{"Time": tm}); err != nil { if err = runtv(tpl, "13 Jun 19 20:39 +0000", map[string]any{"Time": tm}); err != nil {
t.Error(err) t.Error(err)
} }

View File

@@ -24,22 +24,19 @@ const (
func TxtFuncMap() template.FuncMap { func TxtFuncMap() template.FuncMap {
return map[string]any{ return map[string]any{
// Date functions // Date functions
"ago": dateAgo, "ago": dateAgo,
"date": date, "date": date,
"date_in_zone": dateInZone, "dateInZone": dateInZone,
"date_modify": dateModify, "dateModify": dateModify,
"dateInZone": dateInZone, "duration": duration,
"dateModify": dateModify, "durationRound": durationRound,
"duration": duration, "htmlDate": htmlDate,
"durationRound": durationRound, "htmlDateInZone": htmlDateInZone,
"htmlDate": htmlDate, "mustDateModify": mustDateModify,
"htmlDateInZone": htmlDateInZone, "mustToDate": mustToDate,
"must_date_modify": mustDateModify, "now": time.Now,
"mustDateModify": mustDateModify, "toDate": toDate,
"mustToDate": mustToDate, "unixEpoch": unixEpoch,
"now": time.Now,
"toDate": toDate,
"unixEpoch": unixEpoch,
// Strings // Strings
"trunc": trunc, "trunc": trunc,