Skip to content

Commit

Permalink
fix(parsehhmmss): normalize duration after parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
djcsdy committed Apr 23, 2019
1 parent 6761806 commit 5a3b60a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ test("parsehhmmss", t => {
t.deepEqual(parsehhmmss("3:2.5"), {hours: 0, minutes: 3, seconds: 2.5});
t.deepEqual(parsehhmmss("6:5:1"), {hours: 6, minutes: 5, seconds: 1});
t.deepEqual(parsehhmmss("1:48:23.25"), {hours: 1, minutes: 48, seconds: 23.25});
t.deepEqual(parsehhmmss("1:62:77"), {hours: 1, minutes: 62, seconds: 77});
t.deepEqual(parsehhmmss("1:62:77"), {hours: 2, minutes: 3, seconds: 17});
});

test("parsehhmm", t => {
Expand Down
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function parsehhmmss(duration: string): Duration | null {
? 0
: parseFloat(matches[3]);

return {hours, minutes, seconds};
return normalize({hours, minutes, seconds});
}
}

Expand Down

0 comments on commit 5a3b60a

Please sign in to comment.