diff --git a/apps/admin-x-activitypub/src/components/feed/FeedItem.tsx b/apps/admin-x-activitypub/src/components/feed/FeedItem.tsx index 6d31f31176..fcce46f74c 100644 --- a/apps/admin-x-activitypub/src/components/feed/FeedItem.tsx +++ b/apps/admin-x-activitypub/src/components/feed/FeedItem.tsx @@ -137,6 +137,14 @@ function renderInboxAttachment(object: ObjectProperties) { } } +function renderTimestamp(object: ObjectProperties) { + const timestamp = + new Date(object?.published ?? new Date()).toLocaleDateString('default', {year: 'numeric', month: 'short', day: '2-digit'}) + ', ' + new Date(object?.published ?? new Date()).toLocaleTimeString('default', {hour: '2-digit', minute: '2-digit'}); + + const date = new Date(object?.published ?? new Date()); + return ({getRelativeTimestamp(date)}); +} + const FeedItemStats: React.FC<{ object: ObjectProperties; likeCount: number; @@ -217,6 +225,7 @@ const FeedItem: React.FC = ({actor, object, layout, type, comment new Date(object?.published ?? new Date()).toLocaleDateString('default', {year: 'numeric', month: 'short', day: '2-digit'}) + ', ' + new Date(object?.published ?? new Date()).toLocaleTimeString('default', {hour: '2-digit', minute: '2-digit'}); const date = new Date(object?.published ?? new Date()); + const [isCopied, setIsCopied] = useState(false); const onLikeClick = () => { @@ -291,7 +300,7 @@ const FeedItem: React.FC = ({actor, object, layout, type, comment {author.name} {getUsername(author)} - {getRelativeTimestamp(date)} + {renderTimestamp(object)} @@ -338,8 +347,8 @@ const FeedItem: React.FC = ({actor, object, layout, type, comment {/* */} - {author.name} - {getRelativeTimestamp(date)} + {author.name} + {renderTimestamp(object)} {getUsername(author)} @@ -385,11 +394,10 @@ const FeedItem: React.FC = ({actor, object, layout, type, comment - {/* */} - {author.name} - {getRelativeTimestamp(date)} + {author.name} + {renderTimestamp(object)} {getUsername(author)} @@ -412,7 +420,6 @@ const FeedItem: React.FC = ({actor, object, layout, type, comment - {/* */} {!last && }