Untitled

 avatar
unknown
plain_text
6 months ago
444 B
4
Indexable
let hours = 0, minutes = 0, seconds = 0;

function pad(n) {
    return (n < 10 ? '0' : '') + n;
}

function updateTimer() {
    seconds++;
    if (seconds >= 60) {
        seconds = 0;
        minutes++;
    }
    if (minutes >= 60) {
        minutes = 0;
        hours++;
    }
    var count = pad(hours) + ':' + pad(minutes) + ':' + pad(seconds);

    $('#timer_fill').val(count);
    $('#end_duration_fill').val(count);
}
Editor is loading...
Leave a Comment