Decrease starting time window for free response graph

This commit is contained in:
James Grugett 2022-08-26 00:21:06 -05:00 committed by mantikoros
parent eb630dfa46
commit 04a8509212

View File

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