fix(analyticsApi): revert to YYYY-MM-DD
Build and Push Docker image / build-and-push (push) Successful in 2m19s Details

This commit is contained in:
Valentin Kolb 2024-11-13 21:16:34 +01:00
parent 54389e9169
commit cdc6a142ac
1 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ import (
// "count": <total view count since startDate>,
// "last_30_days_data": [
// {
// "date": <ISO 8601>,
// "date": YYYY-MM-DD,
// "count": <daily 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": "<ISO 8601>",
// "date": "YYYY-MM-DD",
// "error_count": <error count for that day>,
// "page_view_count": <total page views for that day>,
// "unique_visitor_count": <unique visitors for that day>
@ -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