From 47a44509cfdc82d88cdd6f37aeeac3a1a84d7786 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Wed, 12 Jun 2013 21:13:22 +1200 Subject: [PATCH] Correct the logic for displaying the end value. --- views/index.tt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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) { -- 2.30.2