From 26f91a02eaafd16a87b23282e9627d732ac30bd4 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Thu, 31 Oct 2019 18:14:02 -0700 Subject: [PATCH] thrimbletrimmer: Parse durations as HH[:MM[:SS]] instead of [[HH:]MM:]SS ie. 1:00 is 1 hour, not 1 minute. This is consistent with our use of bustime everywhere else. --- thrimbletrimmer/scripts/IO.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/thrimbletrimmer/scripts/IO.js b/thrimbletrimmer/scripts/IO.js index 1c33593..561051a 100644 --- a/thrimbletrimmer/scripts/IO.js +++ b/thrimbletrimmer/scripts/IO.js @@ -79,8 +79,7 @@ parseDuration = function(duration) { direction = -1; } var parts = duration.split(':'); - parts.reverse(); - return (parseInt(parts[2] || "0") + (parts[1] || "0")/60 + parts[0]/3600) * 60 * 60 * direction; + return (parseInt(parts[0]) + (parts[1] || "0")/60 + (parts[2] || "0")/3600) * 60 * 60 * direction; } toBustime = function(date) {