From a0349b6c7ea64bc3fe117f4e432e22f98ca1577f Mon Sep 17 00:00:00 2001 From: Ainar Garipov <a.garipov@adguard.com> Date: Thu, 30 Mar 2023 14:37:05 +0300 Subject: [PATCH] Pull request 1792: 5633-invalid-date Updates #5633. Squashed commit of the following: commit 889bc7acb82472d72d7b3103554e70342513a567 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Mar 30 14:31:42 2023 +0300 client: fix dashboard date --- client/src/components/Dashboard/index.js | 2 +- client/src/components/ui/Line.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/components/Dashboard/index.js b/client/src/components/Dashboard/index.js index 73d9c595..54354979 100644 --- a/client/src/components/Dashboard/index.js +++ b/client/src/components/Dashboard/index.js @@ -185,7 +185,7 @@ const Dashboard = ({ </div> )} <Statistics - interval={stats.interval} + interval={msToDays(stats.interval)} dnsQueries={stats.dnsQueries} blockedFiltering={stats.blockedFiltering} replacedSafebrowsing={stats.replacedSafebrowsing} diff --git a/client/src/components/ui/Line.js b/client/src/components/ui/Line.js index 6ced4ab3..ffc218d7 100644 --- a/client/src/components/ui/Line.js +++ b/client/src/components/ui/Line.js @@ -9,11 +9,12 @@ import round from 'lodash/round'; import { useSelector } from 'react-redux'; import PropTypes from 'prop-types'; import './Line.css'; +import { msToDays } from '../../helpers/helpers'; const Line = ({ data, color = 'black', }) => { - const interval = useSelector((state) => state.stats.interval); + const interval = msToDays(useSelector((state) => state.stats.interval)); return <ResponsiveLine enableArea