feat: sort news data by publication date and update column title for clarity
This commit is contained in:
parent
d885b3cf26
commit
aa660f4f5f
@ -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' },
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user