Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Altonss authored Jan 22, 2025
1 parent a87f4b9 commit ab62b9a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ui/src/lib/formatDuration.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
export const formatDurationSec = (t: number): string => {
const hours = Math.floor(t / 3600);
const minutes = Math.ceil((t - hours * 3600) / 60);
const str = [hours !== 0 ? hours + ' h' : '', (minutes !== 0 || hours === 0) ? minutes + ' min' : '']
.join(' ')
const str = [
hours !== 0 ? hours + " h" : "",
minutes !== 0 || hours === 0 ? minutes + " min" : "",
]
.join(" ")
.trim();
return str;
};
Expand Down

0 comments on commit ab62b9a

Please sign in to comment.