From f1e5974cdba50729487e765d92c1d71ab8a2d35e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Wed, 17 Jun 2020 20:24:35 +0100 Subject: [PATCH] fix(ui): tweak DateFromNow output --- ui/src/Components/DateFromNow/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/Components/DateFromNow/index.tsx b/ui/src/Components/DateFromNow/index.tsx index d67a58750..502682f52 100644 --- a/ui/src/Components/DateFromNow/index.tsx +++ b/ui/src/Components/DateFromNow/index.tsx @@ -7,8 +7,8 @@ import formatDistanceToNowStrict from "date-fns/formatDistanceToNowStrict"; const formatLabel = (timestamp: string) => { const ts = parseISO(timestamp); const diff = differenceInSeconds(new Date(), ts); - if (diff > 0 && diff < 60) return "a few seconds ago"; - if (diff < 0 && diff >= -60) return "in a few seconds"; + if (diff > 0 && diff < 45) return "a few seconds ago"; + if (diff < 0 && diff >= -45) return "in a few seconds"; if (diff === 0) return "just now"; return formatDistanceToNowStrict(ts, { addSuffix: true,