From 72911c8d4f071dea7b535315b63b67c8fa007f23 Mon Sep 17 00:00:00 2001 From: Daniel Ledda Date: Sat, 14 Nov 2020 15:39:35 +0100 Subject: [PATCH] Almost there --- server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.go b/server.go index 44dd38d..72e874b 100644 --- a/server.go +++ b/server.go @@ -43,7 +43,7 @@ func showCharts(w http.ResponseWriter, r *http.Request) { } func sendData(w http.ResponseWriter, r *http.Request) { - dateSince := time.Now().UTC().Format(time.RFC3339Nano) + dateSince := strings.SplitAfter(time.Now().UTC().Format(time.RFC3339Nano), "Z")[0] sinceQuery := r.FormValue("since") if sinceQuery != "" { newDateSince, err := time.Parse(time.RFC3339Nano, sinceQuery) @@ -51,7 +51,7 @@ func sendData(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, ROOT_URL, 303) return } - dateSince = newDateSince.Format(time.RFC3339Nano) + dateSince = strings.SplitAfter(newDateSince.Format(time.RFC3339Nano), "Z")[0] } records, err := getSnapshotRecordsFromDb(dateSince) if internalErrorOnErr(fmt.Errorf("couldn't get snapshots from db: %w", err), w, r) { return }