From 54389e9169f3b8ce03a28bb70ee8382e7069536d Mon Sep 17 00:00:00 2001 From: valentinkolb Date: Wed, 13 Nov 2024 20:57:44 +0100 Subject: [PATCH] fix(analyticsApi): only iso 8601 date format --- analyticsApi/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/analyticsApi/main.go b/analyticsApi/main.go index 17e8665..498372e 100644 --- a/analyticsApi/main.go +++ b/analyticsApi/main.go @@ -45,7 +45,7 @@ import ( // "count": , // "last_30_days_data": [ // { -// "date": "YYYY-MM-DDTHH:MM:SSZ", +// "date": , // "count": // }, // ... @@ -104,7 +104,7 @@ func initPageViewCount(app *pocketbase.PocketBase, e *core.ServeEvent) { WHERE created >= {:startDate} `). Bind(dbx.Params{ - "startDate": startDate.Format("2006-01-02 15:04:05"), + "startDate": startDate, }). Row(&totalItems) @@ -147,7 +147,7 @@ func initPageViewCount(app *pocketbase.PocketBase, e *core.ServeEvent) { ) FROM ( SELECT - strftime('%m/%d/%Y %H:%M:%S %Z', created) AS date, + strftime('%Y-%m-%dT%H:%M:%SZ', created) AS date, COUNT(id) AS daily_count FROM analyticsPageViews WHERE