Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/utils/format.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('formatTime', () => {
[30, '30.00 sec'],
[60, '1.00 min'],
[3600, '1.00 h'],
[216000, '60.00 h'],
])('formats %s seconds as %s', (input, expected) => {
expect(formatTime(input)).toBe(expected)
})
Expand Down
2 changes: 1 addition & 1 deletion web/utils/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const formatTime = (seconds: number) => {
if (!seconds) return seconds
const units = ['sec', 'min', 'h']
let index = 0
while (seconds >= 60 && index < units.length) {
while (seconds >= 60 && index < units.length - 1) {
seconds = seconds / 60
index++
}
Expand Down