From 7a30184addf1b78a0f061528bbfa1aa65f7ffee5 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Tue, 16 Dec 2025 05:05:02 +0400 Subject: [PATCH] use localizeddate in post listing --- components/PostListing.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/components/PostListing.tsx b/components/PostListing.tsx index 884d435d..206ca562 100644 --- a/components/PostListing.tsx +++ b/components/PostListing.tsx @@ -13,6 +13,7 @@ import type { Post } from "app/(home-pages)/reader/getReaderFeed"; import Link from "next/link"; import { InteractionPreview } from "./InteractionsPreview"; +import { useLocalizedDate } from "src/hooks/useLocalizedDate"; export const PostListing = (props: Post) => { let pubRecord = props.publication?.pubRecord as @@ -123,17 +124,16 @@ const PubInfo = (props: { }; const PostInfo = (props: { publishedAt: string | undefined }) => { + let localizedDate = useLocalizedDate(props.publishedAt || "", { + year: "numeric", + month: "short", + day: "numeric", + }); return (
{props.publishedAt && ( <> -
- {new Date(props.publishedAt).toLocaleDateString("en-US", { - year: "numeric", - month: "short", - day: "numeric", - })} -
+
{localizedDate}
)}
-- 2.51.2