From 8b0fd7599a7b63c3e50ddab75ad422aeb00d7f01 Mon Sep 17 00:00:00 2001 From: HemalDesai <96279358+HemalDesai@users.noreply.github.com> Date: Mon, 16 Sep 2024 20:47:08 +0530 Subject: [PATCH] fix(ui): timezone display as per UTC (#155) Co-authored-by: Aman Desai <39585600+amandesai01@users.noreply.github.com> --- app/utils/general.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/utils/general.ts b/app/utils/general.ts index 5aff3302..48d7dcb0 100644 --- a/app/utils/general.ts +++ b/app/utils/general.ts @@ -32,23 +32,23 @@ export function timeAgo(date: Date) { const seconds = Math.floor((now.getTime() - date.getTime()) / 1000); let interval = Math.floor(seconds / 31536000); - if (interval > 1) { + if (interval >= 1) { return `${interval}y ago`; } interval = Math.floor(seconds / 2592000); - if (interval > 1) { + if (interval >= 1) { return `${interval}mo ago`; } interval = Math.floor(seconds / 86400); - if (interval > 1) { + if (interval >= 1) { return `${interval}d ago`; } interval = Math.floor(seconds / 3600); - if (interval > 1) { + if (interval >= 1) { return `${interval}h ago`; } interval = Math.floor(seconds / 60); - if (interval > 1) { + if (interval >= 1) { return `${interval}m ago`; } return `Just Now`;