diff --git a/app/src/transformations/commands/transformations/__tests__/formatDuration.test.tsx b/app/src/transformations/commands/transformations/__tests__/formatDuration.test.tsx index f4fed780ea2..fa6c3a954d2 100644 --- a/app/src/transformations/commands/transformations/__tests__/formatDuration.test.tsx +++ b/app/src/transformations/commands/transformations/__tests__/formatDuration.test.tsx @@ -54,7 +54,7 @@ describe('formatDurationLabeled', () => { seconds: 2, } - const expected = '02h 40m 02s' + const expected = '2h 40m 02s' expect(formatDurationLabeled(duration)).toEqual(expected) }) @@ -64,7 +64,7 @@ describe('formatDurationLabeled', () => { seconds: 2, } - const expected = '00h 00m 02s' + const expected = '0h 00m 02s' expect(formatDurationLabeled(duration)).toEqual(expected) }) diff --git a/app/src/transformations/commands/transformations/formatDuration.ts b/app/src/transformations/commands/transformations/formatDuration.ts index f11d02b9c44..2a099bcc79f 100644 --- a/app/src/transformations/commands/transformations/formatDuration.ts +++ b/app/src/transformations/commands/transformations/formatDuration.ts @@ -31,7 +31,7 @@ function timestampDetails( const normalizedMinutes = Math.floor((totalSeconds % 3600) / 60) const normalizedSeconds = totalSeconds % 60 - const paddedHours = padStart(normalizedHours.toString(), 2, '0') + const paddedHours = padStart(normalizedHours.toString(), 1, '0') const paddedMinutes = padStart(normalizedMinutes.toString(), 2, '0') const paddedSeconds = padStart(normalizedSeconds.toString(), 2, '0') return { hours: paddedHours, minutes: paddedMinutes, seconds: paddedSeconds }