From cdc6a142ac7673ccb91bff5adca5c385ca256354 Mon Sep 17 00:00:00 2001 From: valentinkolb Date: Wed, 13 Nov 2024 21:16:34 +0100 Subject: [PATCH] fix(analyticsApi): revert to YYYY-MM-DD --- analyticsApi/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/analyticsApi/main.go b/analyticsApi/main.go index 498372e..370aa5d 100644 --- a/analyticsApi/main.go +++ b/analyticsApi/main.go @@ -45,7 +45,7 @@ import ( // "count": , // "last_30_days_data": [ // { -// "date": , +// "date": YYYY-MM-DD, // "count": // }, // ... @@ -147,7 +147,7 @@ func initPageViewCount(app *pocketbase.PocketBase, e *core.ServeEvent) { ) FROM ( SELECT - strftime('%Y-%m-%dT%H:%M:%SZ', created) AS date, + strftime('%Y-%m-%d', created) AS date, COUNT(id) AS daily_count FROM analyticsPageViews WHERE @@ -326,7 +326,7 @@ func initAggregateCount(app *pocketbase.PocketBase, e *core.ServeEvent) { // // [ // { -// "date": "", +// "date": "YYYY-MM-DD", // "error_count": , // "page_view_count": , // "unique_visitor_count": @@ -369,7 +369,7 @@ func initDailyAnalyticsAggregates(app *pocketbase.PocketBase, e *core.ServeEvent err = app.Dao().DB(). NewQuery(` SELECT - created AS date, + strftime('%Y-%m-%d', created) AS date, COUNT(id) AS page_view_count, SUM(CASE WHEN error IS NOT NULL THEN 1 ELSE 0 END) AS error_count, COUNT(DISTINCT visitor) AS unique_visitor_count