fix(analyticsApi): only iso 8601 date format
Build and Push Docker image / build-and-push (push) Successful in 2m14s Details

This commit is contained in:
Valentin Kolb 2024-11-13 20:57:44 +01:00
parent e32dbbfa0d
commit 54389e9169
1 changed files with 3 additions and 3 deletions

View File

@ -45,7 +45,7 @@ import (
// "count": <total view count since startDate>, // "count": <total view count since startDate>,
// "last_30_days_data": [ // "last_30_days_data": [
// { // {
// "date": "YYYY-MM-DDTHH:MM:SSZ", // "date": <ISO 8601>,
// "count": <daily count> // "count": <daily count>
// }, // },
// ... // ...
@ -104,7 +104,7 @@ func initPageViewCount(app *pocketbase.PocketBase, e *core.ServeEvent) {
WHERE created >= {:startDate} WHERE created >= {:startDate}
`). `).
Bind(dbx.Params{ Bind(dbx.Params{
"startDate": startDate.Format("2006-01-02 15:04:05"), "startDate": startDate,
}). }).
Row(&totalItems) Row(&totalItems)
@ -147,7 +147,7 @@ func initPageViewCount(app *pocketbase.PocketBase, e *core.ServeEvent) {
) )
FROM ( FROM (
SELECT 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 COUNT(id) AS daily_count
FROM analyticsPageViews FROM analyticsPageViews
WHERE WHERE