Fixed date range calculations.

This commit is contained in:
Mike Cao 2020-07-30 22:40:16 -07:00
parent 9f112c8cc9
commit 38abd673f3
8 changed files with 55 additions and 21 deletions

View file

@ -165,7 +165,7 @@ export async function getPageviewData(
return runQuery(
prisma.queryRaw(
`
select date_trunc('${unit}', created_at at time zone '${timezone}') t,
select date_trunc('${unit}', created_at at time zone '${timezone}') at time zone '${timezone}' t,
count(${count}) y
from pageview
where website_id=$1