Skip to content

Commit

Permalink
Add missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Jun 4, 2024
1 parent 17a2235 commit e408993
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/tools/prettyPrintDuration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

export function formatDuration(minutes: number): string {
const hours = Math.floor(minutes / 60);
const remainingMinutes = minutes % 60;
let result = "";

if (hours > 0) {
result += `${hours}h`;
}
if (remainingMinutes > 0) {

result += remainingMinutes === minutes ? `${remainingMinutes} minutes`: `${remainingMinutes}`;
}

return result;
}

0 comments on commit e408993

Please sign in to comment.