From 40e1bac541c198fcd6e35600e17fffe1cdd4ddfd Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Thu, 7 Mar 2024 02:18:15 +0800 Subject: [PATCH] fix: fix telemetry lost timezone problem --- src/server/trpc/routers/telemetry.ts | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/server/trpc/routers/telemetry.ts b/src/server/trpc/routers/telemetry.ts index 6e9e8b9..3a3fdf4 100644 --- a/src/server/trpc/routers/telemetry.ts +++ b/src/server/trpc/routers/telemetry.ts @@ -158,7 +158,16 @@ export const telemetryRouter = router({ ) .output(z.object({ pageviews: z.any(), sessions: z.any() })) .query(async ({ input }) => { - const { telemetryId, startAt, endAt, url, country, region, city } = input; + const { + telemetryId, + startAt, + endAt, + timezone, + url, + country, + region, + city, + } = input; const startDate = new Date(startAt); const endDate = new Date(endAt); @@ -174,6 +183,7 @@ export const telemetryRouter = router({ startDate, endDate, unit: input.unit, + timezone, url, country, region, @@ -216,8 +226,17 @@ export const telemetryRouter = router({ ) ) .query(async ({ input }) => { - const { telemetryId, type, startAt, endAt, url, country, region, city } = - input; + const { + telemetryId, + type, + startAt, + endAt, + timezone, + url, + country, + region, + city, + } = input; const startDate = new Date(startAt); const endDate = new Date(endAt); @@ -231,6 +250,7 @@ export const telemetryRouter = router({ const filters = { startDate, endDate, + timezone, url, country, region,