diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-06-30 15:16:47 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-07-09 19:40:12 +0200 |
| commit | 894db56cb21049ff801b30b3f294854d6da099de (patch) | |
| tree | dba906dde0ff022015714855ae165428bd351414 /pkg/html/html.go | |
| parent | 66bbaf2d5976862ae98e219b389ae2042005639d (diff) | |
pkg/html: add function to format JS time
Diffstat (limited to 'pkg/html/html.go')
| -rw-r--r-- | pkg/html/html.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/html/html.go b/pkg/html/html.go index 1199c5ab0..4bd9621d1 100644 --- a/pkg/html/html.go +++ b/pkg/html/html.go @@ -42,6 +42,7 @@ var Funcs = template.FuncMap{ "formatTime": FormatTime, "formatDate": FormatDate, "formatKernelTime": formatKernelTime, + "formatJSTime": formatJSTime, "formatClock": formatClock, "formatDuration": formatDuration, "formatLateness": formatLateness, @@ -98,6 +99,10 @@ func formatKernelTime(t time.Time) string { return t.Format("Mon Jan 2 15:04:05 2006 -0700") } +func formatJSTime(t time.Time) string { + return t.Format("2006-01-02T15:04:05") // ISO 8601 without time zone +} + func formatClock(t time.Time) string { if t.IsZero() { return "" |
