From 0ac0b8f34c769de37d6239295fed6e78e4d524ca Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 14 Jun 2023 18:36:00 +1000 Subject: [PATCH] fixes for charts --- src/pages/dashboard/components/Totals.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/dashboard/components/Totals.tsx b/src/pages/dashboard/components/Totals.tsx index d0d0eddaf9..3e31ada613 100644 --- a/src/pages/dashboard/components/Totals.tsx +++ b/src/pages/dashboard/components/Totals.tsx @@ -79,8 +79,8 @@ export function Totals() { const [body, setBody] = useState<{ start_date: string; end_date: string }>({ start_date: new Date( new Date().getFullYear(), - new Date().getMonth(), - new Date().getDate() - 7 + new Date().getMonth() - 1, + new Date().getDate() ) .toISOString() .split('T')[0], @@ -111,6 +111,7 @@ export function Totals() { currencies.push({ value: id, label: name as unknown as string }); }); + setCurrency(parseInt(currencies[0].value)); setCurrencies(currencies); setIsLoadingTotals(false); }