From ea58e4f2d1dfeb226c5803aed19e28cacb44b0ae Mon Sep 17 00:00:00 2001 From: ariari04 Date: Tue, 3 Sep 2024 10:58:38 +0600 Subject: [PATCH] fix dates of news --- src/app/news/[id]/page.tsx | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/app/news/[id]/page.tsx b/src/app/news/[id]/page.tsx index 0785d04..698e8c0 100644 --- a/src/app/news/[id]/page.tsx +++ b/src/app/news/[id]/page.tsx @@ -7,16 +7,10 @@ import message from "./icons/message.svg"; import calendar from "./icons/calendar.svg"; import ReviewSection from "@/widgets/ReviewSection/ReviewSection"; -const NewsDetails = async ({ - params, -}: { - params: { id: string }; -}) => { +const NewsDetails = async ({ params }: { params: { id: string } }) => { const getNewsById = async () => { - const response = await apiInstance.get( - `/news/${params.id}/` - ); - + const response = await apiInstance.get(`/news/${params.id}/`); + console.log(response); return response.data; }; @@ -48,9 +42,9 @@ const NewsDetails = async ({ Calendar Icon

{months[data.created_at.slice(5, 7)]}{" "} - {data.created_at.slice(5, 7).slice(0, 1) === "0" - ? data.created_at.slice(6, 7) - : data.created_at.slice(5, 7)} + {data.created_at.slice(8, 10) === "0" + ? data.created_at.slice(9, 10) + : data.created_at.slice(8, 10)} , {data.created_at.slice(0, 4)}