From ba2b90af420b43a9a864a89f64bc056ceb4c3f2e Mon Sep 17 00:00:00 2001 From: Tymoteusz Czech <2625371+Tymek@users.noreply.github.com> Date: Wed, 28 Feb 2024 10:33:49 +0100 Subject: [PATCH] Dashboard charts - always show past 3 months (#6372) --- .../executiveDashboard/LineChart/createChartOptions.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/component/executiveDashboard/LineChart/createChartOptions.ts b/frontend/src/component/executiveDashboard/LineChart/createChartOptions.ts index 698cf6fa82..c3865b0350 100644 --- a/frontend/src/component/executiveDashboard/LineChart/createChartOptions.ts +++ b/frontend/src/component/executiveDashboard/LineChart/createChartOptions.ts @@ -1,4 +1,5 @@ import { Theme } from '@mui/material'; +import { format, subMonths } from 'date-fns'; import { ILocationSettings } from 'hooks/useLocationSettings'; import { TooltipState } from './ChartTooltip/ChartTooltip'; import { createTooltip } from './createTooltip'; @@ -72,6 +73,7 @@ export const createOptions = ( color: theme.palette.text.secondary, display: !isPlaceholder, }, + min: format(subMonths(new Date(), 3), 'yyyy-MM-dd'), }, }, }) as const;