From eea23bbc8ebb7589b4291d23b37106a32d81a834 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Wed, 26 Apr 2023 09:52:50 +0300 Subject: [PATCH] Remove unnecessary helper function `DateFmtLong` (#24343) After #24317 this function is only used in one place where it is not needed. I confirmed the timestamp still renders correctly Signed-off-by: Yarden Shoham --- modules/templates/helper.go | 3 --- templates/admin/cron.tmpl | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/templates/helper.go b/modules/templates/helper.go index b7bef205603f..a290d3897932 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -141,9 +141,6 @@ func NewFuncMap() []template.FuncMap { "TimeSinceUnix": timeutil.TimeSinceUnix, "DateTime": timeutil.DateTime, "Sec2Time": util.SecToTime, - "DateFmtLong": func(t time.Time) string { - return t.Format(time.RFC3339) - }, "LoadTimes": func(startTime time.Time) string { return fmt.Sprint(time.Since(startTime).Nanoseconds()/1e6) + "ms" }, diff --git a/templates/admin/cron.tmpl b/templates/admin/cron.tmpl index 267da00759b5..6ab37ca35484 100644 --- a/templates/admin/cron.tmpl +++ b/templates/admin/cron.tmpl @@ -21,7 +21,7 @@ {{$.locale.Tr (printf "admin.dashboard.%s" .Name)}} {{.Spec}} - {{DateTime "full" (DateFmtLong .Next)}} + {{DateTime "full" .Next}} {{if gt .Prev.Year 1}}{{DateTime "full" .Prev}}{{else}}N/A{{end}} {{.ExecTimes}} {{if eq .Status ""}}—{{else if eq .Status "finished"}}{{svg "octicon-check" 16}}{{else}}{{svg "octicon-x" 16}}{{end}}