summaryrefslogtreecommitdiffstats
path: root/templates/page.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'templates/page.tmpl')
-rw-r--r--templates/page.tmpl9
1 files changed, 4 insertions, 5 deletions
diff --git a/templates/page.tmpl b/templates/page.tmpl
index 576f3d6..44b6a95 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() {