From 906780d9eaf55ca36bb2915b1522e2f07cdd70dc Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Tue, 3 Sep 2024 06:11:14 +0000 Subject: [PATCH] fix(nc-gui): show 1y ago if days diff is greater than 360 --- packages/nc-gui/utils/datetimeUtils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/nc-gui/utils/datetimeUtils.ts b/packages/nc-gui/utils/datetimeUtils.ts index 2924b723ff..46ae5ec375 100644 --- a/packages/nc-gui/utils/datetimeUtils.ts +++ b/packages/nc-gui/utils/datetimeUtils.ts @@ -49,5 +49,9 @@ export const timeAgo = (date: string) => { if (months < 12) { return `${months}mo ago` } + if (years < 1) { + return `1y ago` + } + return `${years}y ago` }