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)