This commit is contained in:
Vlad 2024-05-24 17:11:43 +06:00
parent 4f26c31c36
commit aa4bf468cd
2 changed files with 5 additions and 20 deletions

View File

@ -1,14 +0,0 @@
export const MONTHS: Record<string, string> = {
"01": "Январь",
"02": "Февраль",
"03": "Март",
"04": "Апрель",
"05": "Май",
"06": "Июнь",
"07": "Июль",
"08": "Август",
"09": "Сентябрь",
"10": "Октябрь",
"11": "Ноябрь",
"12": "Декабрь",
};

View File

@ -6,7 +6,6 @@ import { ILocation } from "@/shared/types/location-type";
import calendar from "./icons/calendar.svg"; import calendar from "./icons/calendar.svg";
import { ROAD_TYPES_COLORS } from "@/shared/variables/road-types"; import { ROAD_TYPES_COLORS } from "@/shared/variables/road-types";
import Image from "next/image"; import Image from "next/image";
import { MONTHS } from "@/shared/variables/month";
import ShowMapButton from "@/features/ShowMapButton/ShowMapButton"; import ShowMapButton from "@/features/ShowMapButton/ShowMapButton";
import { getTranslations } from "next-intl/server"; import { getTranslations } from "next-intl/server";
@ -49,11 +48,11 @@ const ReportInformation: React.FC<IReportInformationProps> = async ({
<div className="report-information__date"> <div className="report-information__date">
<Image src={calendar} alt="Calendar Icon" /> <Image src={calendar} alt="Calendar Icon" />
<p> <p>
{MONTHS[date.slice(5, 7)]}{" "} {new Date(date).toLocaleDateString('ru-RU', {
{date.slice(5, 7).slice(0, 1) === "0" day: 'numeric',
? date.slice(6, 7) month: 'long',
: date.slice(5, 7)} year: 'numeric'
, {date.slice(0, 4)} })}
</p> </p>
</div> </div>
<ReportLike count={total_likes} report_id={id} /> <ReportLike count={total_likes} report_id={id} />