Skip to content

Commit

Permalink
regionscore: display CP minutes instead of '00'
Browse files Browse the repository at this point in the history
  • Loading branch information
McBen authored Jan 29, 2025
1 parent 7d30f9c commit bab79be
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions core/code/region_scoreboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,26 +429,26 @@ window.RegionScoreboardSetup = (function () {
$('#cycletimer', mainDialog).html(formatMinutes(Math.max(0, Math.floor(d / 1000))));
}

function pad(n) {
return window.zeroPad(n, 2);
}

function formatMinutes(sec) {
var hours = Math.floor(sec / 3600);
var minutes = Math.floor((sec % 3600) / 60);
sec = sec % 60;

var time = '';
time += hours + ':';
if (minutes < 10) time += '0';
time += minutes;
time += ':';
if (sec < 10) time += '0';
time += sec;
return time;
return hours + ':' + pad(minutes) + ':' + pad(sec);
}

function formatHours(time) {
return ('0' + time.getHours()).slice(-2) + ':00';
return pad(time.getHours()) + ':' + pad(time.getMinutes());
}
function formatDay(time) {
return pad(time.getDate()) + '.' + pad(time.getMonth() + 1);
}
function formatDayHours(time) {
return ('0' + time.getDate()).slice(-2) + '.' + ('0' + (time.getMonth() + 1)).slice(-2) + ' ' + ('0' + time.getHours()).slice(-2) + ':00';
return formatDay(time) + ' ' + formatHours(time);
}

return function setup() {
Expand Down

0 comments on commit bab79be

Please sign in to comment.