We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c0ef710 commit 47bddc2Copy full SHA for 47bddc2
src/composables/useOutputDuration.ts
@@ -1,12 +1,14 @@
1
export function useOutputDuration() {
2
function durationToMinutes(duration: string): number {
3
- let hours: number = 0
4
- let minutes: number = 0
+ let hours = 0
+ let minutes = 0
5
6
const lowerDuration = duration.toLowerCase()
7
8
if (lowerDuration.includes(':')) {
9
- [hours, minutes] = lowerDuration.split(':').map(part => +(part?.trim() || '0'))
+ const [h, m] = lowerDuration.split(':').map(part => +(part?.trim() || '0'))
10
+ hours = h ?? 0
11
+ minutes = m ?? 0
12
}
13
else {
14
if (lowerDuration.includes('h')) {
0 commit comments