From 7672cd409aaf8cdf4ae2caf8a1f403c7d86c7fcd Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 23 Nov 2014 01:48:04 +0100 Subject: [PATCH] Do not show seconds in the clocks; a bit too distracting. --- www/js/remoteglot.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/www/js/remoteglot.js b/www/js/remoteglot.js index 01fee37..9635c91 100644 --- a/www/js/remoteglot.js +++ b/www/js/remoteglot.js @@ -872,8 +872,8 @@ var update_clock = function() { if (data['position'] && data['position']['white_clock'] && data['position']['black_clock']) { - white_clock = data['position']['white_clock']; - black_clock = data['position']['black_clock']; + white_clock = data['position']['white_clock'].replace(/:[0-5][0-9]$/, ""); + black_clock = data['position']['black_clock'].replace(/:[0-5][0-9]$/, ""); } // Dynamic clock (only one, obviously). @@ -893,7 +893,7 @@ var update_clock = function() { } // See when the clock will change next, and update right after that. - var next_update_ms = remaining_ms % 1000 + 100; + var next_update_ms = remaining_ms % 60000 + 100; clock_timer = setTimeout(update_clock, next_update_ms); } @@ -906,7 +906,7 @@ var update_clock = function() { */ var format_clock = function(remaining_ms) { if (remaining_ms <= 0) { - return "00:00:00"; + return "00:00"; } var remaining = Math.floor(remaining_ms / 1000); @@ -915,7 +915,7 @@ var format_clock = function(remaining_ms) { var minutes = remaining % 60; remaining = (remaining - minutes) / 60; var hours = remaining; - return format_2d(hours) + ":" + format_2d(minutes) + ":" + format_2d(seconds); + return format_2d(hours) + ":" + format_2d(minutes); } /** -- 2.39.2