From 3df3eb243217140e7918f62166d9e949574b30e8 Mon Sep 17 00:00:00 2001 From: Nastya Date: Mon, 28 Jul 2025 19:12:54 +0300 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D0=B2=D1=8B=D0=B2?= =?UTF-8?q?=D0=BE=D0=B4=D0=BE=D0=B2=20=D0=B3=D1=80=D0=B0=D1=84=D0=B8=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2=20(=D1=87=D1=82=D0=BE=20=D0=BF=D1=80=D0=B8=D1=88?= =?UTF-8?q?=D0=BB=D0=BE=20=D1=82=D0=BE=20=D0=B8=20=D0=B2=D1=8B=D0=B2=D0=B5?= =?UTF-8?q?=D0=BB=D0=BE=D1=81=D1=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Analytics/General.tsx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/pages/Analytics/General.tsx b/src/pages/Analytics/General.tsx index 33f6d581..78ce3a9f 100644 --- a/src/pages/Analytics/General.tsx +++ b/src/pages/Analytics/General.tsx @@ -42,16 +42,9 @@ const GeneralItem = ({ ([nextValue], [currentValue]) => Number(nextValue) - Number(currentValue), ); const days = data.map(([value]) => value); - const { time } = data.reduce( - (total, [_, value]) => ({ - defaultValue: value > 0 ? value : total.defaultValue, - time: [...total.time, value > 0 ? value : total.defaultValue], - }), - { defaultValue: 0, time: [] as number[] }, - ); const numberValue = calculateTime - ? time.reduce((total, value) => total + value, 0) / days.length + ? Object.values(general).reduce((total, value) => total + value, 0) / Object.values(general).length : conversionValue ? conversionValue : Object.values(general).reduce((total, item) => total + item, 0); @@ -82,17 +75,17 @@ const GeneralItem = ({ { const timestamp = Number(value); if (isNaN(timestamp)) return 'Invalid Date'; - return moment.unix(timestamp).format(statiscticsResult ? "DD/MM/YYYY" : "DD/MM/YYYY HH") + (statiscticsResult ? "" : "ч"); + return moment.unix(timestamp).format("DD/MM/YYYY"); }, }, ]} series={[ { - data: Object.values(statiscticsResult ? time : general), + data: Object.values(general), valueFormatter: (value) => calculateTime ? getCalculatedTime(value)