From 96224f8d4cf9b7de1dad504bdfcfe51547185461 Mon Sep 17 00:00:00 2001 From: Anang Yusman Date: Tue, 3 Mar 2026 14:32:38 +0800 Subject: [PATCH] update landing --- components/landing-page/development.tsx | 17 +++++++---- components/landing-page/header.tsx | 36 ++++++++++++++++-------- components/landing-page/health.tsx | 26 +++++++++++++++-- components/landing-page/latest-news.tsx | 17 +++++++---- components/landing-page/opinion-news.tsx | 17 +++++++---- 5 files changed, 85 insertions(+), 28 deletions(-) diff --git a/components/landing-page/development.tsx b/components/landing-page/development.tsx index af8745b..076e515 100644 --- a/components/landing-page/development.tsx +++ b/components/landing-page/development.tsx @@ -112,11 +112,18 @@ export default function Development() {

- {new Date(item.publishedAt).toLocaleDateString("id-ID", { - day: "numeric", - month: "long", - year: "numeric", - })} + {new Date(item?.publishedAt ?? item?.createdAt) + .toLocaleString("id-ID", { + day: "numeric", + month: "long", + year: "numeric", + hour: "2-digit", + minute: "2-digit", + hour12: false, + timeZone: "Asia/Jakarta", + }) + .replace("pukul ", "")}{" "} + WIB

diff --git a/components/landing-page/header.tsx b/components/landing-page/header.tsx index 4f78c7d..d98e4cd 100644 --- a/components/landing-page/header.tsx +++ b/components/landing-page/header.tsx @@ -37,6 +37,7 @@ export default function Header() { const res = await getListArticle(req); setArticles(res?.data?.data || []); + console.log("data slider", res?.data?.data || []); }; fetchArticles(); @@ -144,14 +145,20 @@ export default function Header() { - {new Date(mainArticle.publishedAt).toLocaleDateString( - "id-ID", - { - day: "2-digit", + {new Date( + mainArticle?.publishedAt ?? mainArticle?.createdAt, + ) + .toLocaleString("id-ID", { + day: "numeric", month: "long", year: "numeric", - } - )} + hour: "2-digit", + minute: "2-digit", + hour12: false, + timeZone: "Asia/Jakarta", + }) + .replace("pukul ", "")}{" "} + WIB @@ -190,11 +197,18 @@ export default function Header() { {item.title}

- {new Date(item.publishedAt).toLocaleDateString("id-ID", { - day: "2-digit", - month: "long", - year: "numeric", - })} + {new Date(item?.publishedAt ?? item?.createdAt) + .toLocaleString("id-ID", { + day: "numeric", + month: "long", + year: "numeric", + hour: "2-digit", + minute: "2-digit", + hour12: false, + timeZone: "Asia/Jakarta", + }) + .replace("pukul ", "")}{" "} + WIB diff --git a/components/landing-page/health.tsx b/components/landing-page/health.tsx index 7d72ef4..6fb18dc 100644 --- a/components/landing-page/health.tsx +++ b/components/landing-page/health.tsx @@ -98,7 +98,18 @@ export default function NewsTerkini() { {/* AUTHOR + DATE */}

By {item.customCreatorName || item.createdByName} —{" "} - {formatDate(item.publishedAt)} + {new Date(item?.publishedAt ?? item?.createdAt) + .toLocaleString("id-ID", { + day: "numeric", + month: "long", + year: "numeric", + hour: "2-digit", + minute: "2-digit", + hour12: false, + timeZone: "Asia/Jakarta", + }) + .replace("pukul ", "")}{" "} + WIB

@@ -144,7 +155,18 @@ export default function NewsTerkini() { {item.title}

- {formatDate(item.createdAt)} + {new Date(item?.publishedAt ?? item?.createdAt) + .toLocaleString("id-ID", { + day: "numeric", + month: "long", + year: "numeric", + hour: "2-digit", + minute: "2-digit", + hour12: false, + timeZone: "Asia/Jakarta", + }) + .replace("pukul ", "")}{" "} + WIB

diff --git a/components/landing-page/latest-news.tsx b/components/landing-page/latest-news.tsx index b01a2d1..61a1237 100644 --- a/components/landing-page/latest-news.tsx +++ b/components/landing-page/latest-news.tsx @@ -100,11 +100,18 @@ export default function News() { - - {new Date(item.publishedAt).toLocaleDateString("id-ID", { - day: "numeric", - month: "long", - year: "numeric", - })} + {new Date(item?.publishedAt ?? item?.createdAt) + .toLocaleString("id-ID", { + day: "numeric", + month: "long", + year: "numeric", + hour: "2-digit", + minute: "2-digit", + hour12: false, + timeZone: "Asia/Jakarta", + }) + .replace("pukul ", "")}{" "} + WIB diff --git a/components/landing-page/opinion-news.tsx b/components/landing-page/opinion-news.tsx index 90edd40..9d4d849 100644 --- a/components/landing-page/opinion-news.tsx +++ b/components/landing-page/opinion-news.tsx @@ -100,11 +100,18 @@ export default function OpinionNews() { - - {new Date(item.publishedAt).toLocaleDateString("id-ID", { - day: "numeric", - month: "long", - year: "numeric", - })} + {new Date(item?.publishedAt ?? item?.createdAt) + .toLocaleString("id-ID", { + day: "numeric", + month: "long", + year: "numeric", + hour: "2-digit", + minute: "2-digit", + hour12: false, + timeZone: "Asia/Jakarta", + }) + .replace("pukul ", "")}{" "} + WIB