fix: made statistic dates PATRIOTIC

This commit is contained in:
2024-11-21 21:11:26 +04:00
parent 9c56ef180f
commit 0758d14a9a
3 changed files with 13 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import { Skeleton, Stack } from "@mantine/core";
import { ProfitChartFiltersModal } from "../../modals/ProfitChartFiltersModal.tsx";
import { Total } from "../Total/Total.tsx";
import styles from "../../../../ui/StatisticsPage.module.css";
import { formatDate } from "../../../../../../types/utils.ts";
export const ProfitChart = () => {
@@ -15,6 +16,12 @@ export const ProfitChart = () => {
isLoading,
} = useProfitChart();
const formattedProfitData = profitData.map(
value => {
return { ...value, date: formatDate(value.date) };
},
);
const getChartsSeries = [
[
{ name: "profit", label: "Прибыль", color: "indigo.6" },
@@ -42,7 +49,7 @@ export const ProfitChart = () => {
my={"sm"}
w={"98%"}
h={"34vh"}
data={profitData}
data={formattedProfitData}
dataKey="date"
unit={units[idx]}
tooltipAnimationDuration={200}