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 { 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<IReportInformationProps> = async ({
<div className="report-information__date">
<Image src={calendar} alt="Calendar Icon" />
<p>
{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'
})}
</p>
</div>
<ReportLike count={total_likes} report_id={id} />