diff options
Diffstat (limited to '')
-rw-r--r-- | templates/page.tmpl | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/templates/page.tmpl b/templates/page.tmpl index 576f3d66..44b6a957 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -69,12 +69,11 @@ let qnaVideo; // some pages have a questions and answers video let timestamps; - // expects a string like "mm:ss" + // expects a string like "mm:ss.mmm" function parseSeconds(timeString) { - const times = timeString.split(":"); - const minutes = parseFloat(times[0]); - const seconds = parseFloat(times[1]); - return (minutes * 60) + seconds; + return timeString.split(":").reduce(function(prev, o) { + return prev * 60 + parseFloat(o); + }); } window.onload = function initScript() { |