Skip to content

Commit 074d7ca

Browse files
refactor(web): update-time-left-until-function
1 parent 5ec36e5 commit 074d7ca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

web/src/utils/date.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ export function timeLeftUntil(isoString: string): string {
6060
const daysLeft = Math.floor(hoursLeft / 24);
6161

6262
if (secondsLeft < 60) {
63-
return `in ${secondsLeft} secs`;
63+
return `in ${secondsLeft} sec${secondsLeft > 1 ? "s" : ""}`;
6464
} else if (minutesLeft < 60) {
65-
return `in ${minutesLeft} mins`;
65+
return `in ${minutesLeft} min${minutesLeft > 1 ? "s" : ""}`;
6666
} else if (hoursLeft < 24) {
67-
return `in ${hoursLeft} hrs`;
67+
return `in ${hoursLeft} hr${hoursLeft > 1 ? "s" : ""}`;
6868
} else if (daysLeft < 2) {
69-
return `in ${daysLeft} days`;
69+
return `in ${daysLeft} day${daysLeft > 1 ? "s" : ""}`;
7070
} else {
7171
const options: Intl.DateTimeFormatOptions = { year: "numeric", month: "long", day: "numeric" };
7272
return `after ${targetDate.toLocaleDateString("en-US", options)}`;

0 commit comments

Comments
 (0)