Decrease starting time window for free response graph

This commit is contained in:
James Grugett 2022-08-26 00:21:06 -05:00
parent e5777f02d8
commit 539bfba70c

View File

@ -71,10 +71,10 @@ export const AnswersGraph = memo(function AnswersGraph(props: {
const yTickValues = [0, 25, 50, 75, 100]
const numXTickValues = isLargeWidth ? 5 : 2
const hoursAgo = latestTime.subtract(5, 'hours')
const startDate = dayjs(contract.createdTime).isBefore(hoursAgo)
const hourAgo = latestTime.subtract(1, 'hours')
const startDate = dayjs(contract.createdTime).isBefore(hourAgo)
? new Date(contract.createdTime)
: hoursAgo.toDate()
: hourAgo.toDate()
const multiYear = !dayjs(startDate).isSame(latestTime, 'year')
const lessThanAWeek = dayjs(startDate).add(1, 'week').isAfter(latestTime)