From 539bfba70cea9ebad8bfa2ab5f85c615b3f620f5 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Fri, 26 Aug 2022 00:21:06 -0500 Subject: [PATCH] Decrease starting time window for free response graph --- web/components/answers/answers-graph.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/components/answers/answers-graph.tsx b/web/components/answers/answers-graph.tsx index 27152db9..cf70fc02 100644 --- a/web/components/answers/answers-graph.tsx +++ b/web/components/answers/answers-graph.tsx @@ -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)