diff options
Diffstat (limited to 'frontend/src/components/FeedItem.tsx')
| -rw-r--r-- | frontend/src/components/FeedItem.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
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) { </p> <div className="mt-2 flex items-center gap-4 text-sm"> <span className="text-gray-400"> - Last fetched: {new Date(feed.fetchedAt).toLocaleString()} + Last fetched: {formatDateTime(new Date(feed.fetchedAt))} </span> </div> </div> @@ -84,3 +84,13 @@ export function FeedItem({ feed, onFeedUnsubscribed }: Props) { </div> ); } + +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}`; +} |
