diff options
Diffstat (limited to 'src/lib/utils.ts')
-rw-r--r-- | src/lib/utils.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/utils.ts b/src/lib/utils.ts index c871387..5dd0fc0 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -95,6 +95,9 @@ interface MillisecondsToTimeOpts { } export function millisecondsToTime(totalMilliseconds: number, opts: MillisecondsToTimeOpts = {}) { + if (totalMilliseconds < 0) { + return 'Invalid time' + } const totalSeconds = totalMilliseconds / 1000 const totalMinutes = totalSeconds / 60 const totalHours = totalMinutes / 60 |