From da63ff8de9de86f01c232acd582e89e021bc1b01 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 13 Jul 2025 16:17:39 +0900 Subject: feat(frontend): change datetime format --- frontend/src/components/FeedItem.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'frontend/src/components/FeedItem.tsx') diff --git a/frontend/src/components/FeedItem.tsx b/frontend/src/components/FeedItem.tsx index 020825a..29cd531 100644 --- a/frontend/src/components/FeedItem.tsx +++ b/frontend/src/components/FeedItem.tsx @@ -50,7 +50,7 @@ export function FeedItem({ feed, onFeedUnsubscribed }: Props) {

- Last fetched: {new Date(feed.fetchedAt).toLocaleString()} + Last fetched: {formatDateTime(new Date(feed.fetchedAt))}
@@ -84,3 +84,13 @@ export function FeedItem({ feed, onFeedUnsubscribed }: Props) { ); } + +function formatDateTime(date: Date): string { + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, "0"); + const day = String(date.getDate()).padStart(2, "0"); + const hours = String(date.getHours()).padStart(2, "0"); + const minutes = String(date.getMinutes()).padStart(2, "0"); + + return `${year}-${month}-${day} ${hours}:${minutes}`; +} -- cgit v1.2.3-70-g09d2