From c555be7b5887d8dfb1a118bff9cffbb53d7685c6 Mon Sep 17 00:00:00 2001 From: SimonFedick Date: Tue, 2 Feb 2021 11:55:03 +0100 Subject: [PATCH] fixed voting timer display --- frontend/js/not_libs/displayActiveVote.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/js/not_libs/displayActiveVote.js b/frontend/js/not_libs/displayActiveVote.js index 3ec4e8c..32a1fc0 100644 --- a/frontend/js/not_libs/displayActiveVote.js +++ b/frontend/js/not_libs/displayActiveVote.js @@ -64,8 +64,8 @@ $(document).ready( function() { /** * Purpose of this function is to countdown a vote duration and to display it. - * sessionstorage is used to store and retreive seconds for timer. - * This function will take only one paramter i.e. + * sessionStorage is used to store and retrieve seconds for timer. + * This function will take only one parameter i.e. * @param seconds * Once the timer ends it will call displayActiveVote function again to display vote expiry message. * This will accept only one argument i.e. @@ -83,8 +83,8 @@ function countdown(seconds) { var hd_counter = document.getElementById("hdtimer"); var t_hours = Math.floor(seconds / (60 * 60)); - var t_minutes = parseInt(seconds/60); - var t_seconds = seconds % 60; + var t_minutes = parseInt(seconds/60) % 60; //Only count minutes up to one hour + var t_seconds = seconds % 60; //Only count seconds up to one minute if (counter) { counter.innerHTML = ""+window.languageData["voting"]["timeLeft"]+ ": " + t_hours + "hr: " + t_minutes + "min: " + (t_seconds < 10 ? "0" : "") + t_seconds + "sec"; }