Exclude partial day from analytics

This commit is contained in:
James Grugett 2022-05-22 17:35:10 -05:00
parent 2a5b68977b
commit f85b10e517

View File

@ -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([