We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c3ec80 commit 6495fb7Copy full SHA for 6495fb7
src/helpers/duration.helpers.ts
@@ -4,7 +4,7 @@ export function importDuration(value: string) {
4
.split(":")
5
.reverse()
6
.map((e) => Number(e));
7
- return (seconds ?? 0) + (minutes ?? 0) * 60 + (hours ?? 0) * 3600 + (milliseconds ? Number(milliseconds.padEnd(3, "0") ?? 0) / 1000 : 0);
+ return (seconds ?? 0) + (minutes ?? 0) * 60 + (hours ?? 0) * 3600 + (milliseconds ? Number(milliseconds.padEnd(milliseconds.length, "0") ?? 0) / Number("1".padEnd(milliseconds.length + 1, "0")) : 0);
8
}
9
10
export function formatDuration(x: number, precision = 0) {
0 commit comments