From aa660f4f5fd8cb909044b97c45b8b51d0381bb52 Mon Sep 17 00:00:00 2001 From: Ardeman Date: Fri, 7 Mar 2025 14:43:12 +0800 Subject: [PATCH] feat: sort news data by publication date and update column title for clarity --- app/pages/dashboard-contents/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/pages/dashboard-contents/index.tsx b/app/pages/dashboard-contents/index.tsx index 8c65ccb..16e1f52 100644 --- a/app/pages/dashboard-contents/index.tsx +++ b/app/pages/dashboard-contents/index.tsx @@ -18,7 +18,9 @@ export const ContentsPage = () => { const newsData = loaderData?.newsData DataTable.use(DT) - const dataTable = newsData + const dataTable = newsData?.sort( + (a, b) => new Date(b.live_at).getTime() - new Date(a.live_at).getTime(), + ) const dataColumns = [ { title: 'No', @@ -36,7 +38,7 @@ export const ContentsPage = () => { data: 'live_at', }, { - title: 'Nama Penulis', + title: 'Penulis', }, { title: 'Judul', data: 'title' }, {