From fb20bdc65e32dbe56f3e8d6eefdc611872dffd84 Mon Sep 17 00:00:00 2001 From: r Date: Fri, 10 Jan 2020 04:05:01 +0000 Subject: Use readable timestamp for statuses --- renderer/renderer.go | 5 +++++ templates/status.tmpl | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/renderer/renderer.go b/renderer/renderer.go index efc412d..4065312 100644 --- a/renderer/renderer.go +++ b/renderer/renderer.go @@ -41,6 +41,7 @@ func NewRenderer(templateGlobPattern string) (r *renderer, err error) { "DisplayInteractionCount": DisplayInteractionCount, "TimeSince": TimeSince, "FormatTimeRFC3339": FormatTimeRFC3339, + "FormatTimeRFC822": FormatTimeRFC822, }).ParseGlob(templateGlobPattern) if err != nil { return @@ -175,3 +176,7 @@ func TimeSince(t time.Time) string { func FormatTimeRFC3339(t time.Time) string { return t.Format(time.RFC3339) } + +func FormatTimeRFC822(t time.Time) string { + return t.Format(time.RFC822) +} diff --git a/templates/status.tmpl b/templates/status.tmpl index 669fca8..24c318f 100644 --- a/templates/status.tmpl +++ b/templates/status.tmpl @@ -134,7 +134,7 @@
- +
-- cgit v1.2.3