From aa4bf468cd053e79cd6d3ad74103c849413709c7 Mon Sep 17 00:00:00 2001 From: Vlad Date: Fri, 24 May 2024 17:11:43 +0600 Subject: [PATCH] fix date --- src/shared/variables/month.ts | 14 -------------- .../ReportInformation/ReportInformation.tsx | 11 +++++------ 2 files changed, 5 insertions(+), 20 deletions(-) delete mode 100644 src/shared/variables/month.ts diff --git a/src/shared/variables/month.ts b/src/shared/variables/month.ts deleted file mode 100644 index 4ab411f..0000000 --- a/src/shared/variables/month.ts +++ /dev/null @@ -1,14 +0,0 @@ -export const MONTHS: Record = { - "01": "Январь", - "02": "Февраль", - "03": "Март", - "04": "Апрель", - "05": "Май", - "06": "Июнь", - "07": "Июль", - "08": "Август", - "09": "Сентябрь", - "10": "Октябрь", - "11": "Ноябрь", - "12": "Декабрь", -}; diff --git a/src/widgets/report-details/ReportInformation/ReportInformation.tsx b/src/widgets/report-details/ReportInformation/ReportInformation.tsx index 4217599..043878b 100644 --- a/src/widgets/report-details/ReportInformation/ReportInformation.tsx +++ b/src/widgets/report-details/ReportInformation/ReportInformation.tsx @@ -6,7 +6,6 @@ import { ILocation } from "@/shared/types/location-type"; import calendar from "./icons/calendar.svg"; import { ROAD_TYPES_COLORS } from "@/shared/variables/road-types"; import Image from "next/image"; -import { MONTHS } from "@/shared/variables/month"; import ShowMapButton from "@/features/ShowMapButton/ShowMapButton"; import { getTranslations } from "next-intl/server"; @@ -49,11 +48,11 @@ const ReportInformation: React.FC = async ({
Calendar Icon

- {MONTHS[date.slice(5, 7)]}{" "} - {date.slice(5, 7).slice(0, 1) === "0" - ? date.slice(6, 7) - : date.slice(5, 7)} - , {date.slice(0, 4)} + {new Date(date).toLocaleDateString('ru-RU', { + day: 'numeric', + month: 'long', + year: 'numeric' + })}