From: Andrew Ruthven Date: Wed, 12 Jun 2013 09:13:22 +0000 (+1200) Subject: Correct the logic for displaying the end value. X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=etcx-sounds.git Correct the logic for displaying the end value. --- diff --git a/views/index.tt b/views/index.tt index 948408a..0fe56d6 100644 --- a/views/index.tt +++ b/views/index.tt @@ -27,19 +27,19 @@ var end = 0; var title = ''; var artist = ''; -function displayTime(ms) { - var toDisplay = ms; +function displayTime(time) { + var toDisplay = time; - if (ms > end) { + if (time > end) { toDisplay = end; } - var mms = ms % 1000; - ms = (ms - mms) / 1000; - var ss = ms % 60; - ms = (ms - ss) / 60; - var mm = ms % 60; - var hh = (ms - mm) / 60; + var ms = toDisplay % 1000; + toDisplay = (toDisplay - ms) / 1000; + var ss = toDisplay % 60; + toDisplay = (toDisplay - ss) / 60; + var mm = toDisplay % 60; + var hh = (toDisplay - mm) / 60; var t = ""; if (hh > 0) {