Skip to content

Commit

Permalink
fix: shortens hours and minutes in notif emails
Browse files Browse the repository at this point in the history
  • Loading branch information
towfiqi committed Dec 8, 2022
1 parent 62e0fba commit 480767d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/generateEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ const timeSince = (date:number) : string => {
if (interval >= 1) return `${interval} days ago`;

interval = Math.floor(seconds / 3600);
if (interval >= 1) return `${interval} hours ago`;
if (interval >= 1) return `${interval} hrs ago`;

interval = Math.floor(seconds / 60);
if (interval > 1) return `${interval} minutes ago`;
if (interval > 1) return `${interval} mins ago`;

return `${Math.floor(seconds)} seconds ago`;
return `${Math.floor(seconds)} secs ago`;
};

/**
Expand Down

0 comments on commit 480767d

Please sign in to comment.