Skip to content

Commit

Permalink
fix(ui): timezone display as per UTC (#155)
Browse files Browse the repository at this point in the history
Co-authored-by: Aman Desai <[email protected]>
  • Loading branch information
HemalDesai and amandesai01 authored Sep 16, 2024
1 parent f7eb63a commit 8b0fd75
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/utils/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down

0 comments on commit 8b0fd75

Please sign in to comment.