From f85b10e5174afd14d7d28602d422497693353201 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Sun, 22 May 2022 17:35:10 -0500 Subject: [PATCH] Exclude partial day from analytics --- web/pages/analytics.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web/pages/analytics.tsx b/web/pages/analytics.tsx index 2e14b50a..1b6a5a2c 100644 --- a/web/pages/analytics.tsx +++ b/web/pages/analytics.tsx @@ -19,12 +19,11 @@ import { getDailyNewUsers } from 'web/lib/firebase/users' export const getStaticProps = fromPropz(getStaticPropz) export async function getStaticPropz() { const numberOfDays = 45 - const tomorrow = dayjs(dayjs().format('YYYY-MM-DD')) - .add(1, 'day') + const today = dayjs(dayjs().format('YYYY-MM-DD')) // Convert from UTC midnight to PT midnight. .add(7, 'hours') - const startDate = tomorrow.subtract(numberOfDays, 'day') + const startDate = today.subtract(numberOfDays, 'day') const [dailyBets, dailyContracts, dailyComments, dailyNewUsers] = await Promise.all([