From 9979d911c73319b84e07675d51fc66c53d94a1c0 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Thu, 9 May 2019 20:37:22 +0100 Subject: [PATCH] Parse strings as time if needed --- util/fncs/args.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/fncs/args.go b/util/fncs/args.go index ac7c8241..74491d20 100644 --- a/util/fncs/args.go +++ b/util/fncs/args.go @@ -132,6 +132,10 @@ func ensureTime(val interface{}) (out time.Time, ok bool) { switch val := val.(type) { case time.Time: return val, true + case string: + if val, err := time.Parse(time.RFC3339Nano, val); err == nil { + return val, true + } } return defaultTime, false }