From 4aa5e4f0919d6a98c380ce1d5f7d65e64a7e6c48 Mon Sep 17 00:00:00 2001 From: Djordje Vlaisavljevic Date: Thu, 19 Sep 2024 20:27:05 +0100 Subject: [PATCH] Added `Just now` as a timestamp ref https://linear.app/tryghost/issue/AP-282/render-notes-in-the-frontend --- .../admin-x-activitypub/src/utils/get-relative-timestamp.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/admin-x-activitypub/src/utils/get-relative-timestamp.ts b/apps/admin-x-activitypub/src/utils/get-relative-timestamp.ts index b36554270f..645fdaf3b1 100644 --- a/apps/admin-x-activitypub/src/utils/get-relative-timestamp.ts +++ b/apps/admin-x-activitypub/src/utils/get-relative-timestamp.ts @@ -26,8 +26,12 @@ export const getRelativeTimestamp = (date: Date): string => { if (interval >= 1) { return `${interval}m`; } + + if (seconds < 1) { + return `Just now`; + } - return `${seconds} seconds`; + return `${seconds}s`; }; export default getRelativeTimestamp; \ No newline at end of file