Skip to content

Commit

Permalink
Check that calculated duration is always positive
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrekV committed Jan 12, 2016
1 parent a3af57d commit 9fc2c12
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/scripts/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ function setCursorAtBeginning(elem) {
}

function secondsToTime(duration, format) {
duration = Math.abs(duration);
var response,
seconds = parseInt(duration % 60, 10),
minutes = parseInt((duration / 60) % 60, 10),
Expand Down

0 comments on commit 9fc2c12

Please sign in to comment.