Skip to content

Commit

Permalink
chore: display under one minute if timer is zero or negative
Browse files Browse the repository at this point in the history
  • Loading branch information
gentlementlegen committed Dec 16, 2024
1 parent 714ed56 commit eb5151d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/handlers/time-format.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export function formatMillisecondsToHumanReadable(milliseconds: number): string {
if (milliseconds <= 0) {
return "0 days, 0 hours, and 0 minutes";
return "< 1 minute";
}
const days = Math.floor(milliseconds / (1000 * 60 * 60 * 24));
const hours = Math.floor((milliseconds % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
Expand Down

0 comments on commit eb5151d

Please sign in to comment.