Sha256: f2844631b3f017363acae205d67b1beba81d871aaf96266088b731fa9f83f693
Contents?: true
Size: 628 Bytes
Versions: 18
Compression:
Stored size: 628 Bytes
Contents
mumuki.startTimer = (() => { function startTimer(endDate) { var endTime = new Date(endDate).getTime(); var currentTime = Date.now(); var diffTime = endTime - currentTime; var duration = moment.duration(diffTime, 'milliseconds'); var intervalDuration = 1000; var interval = mumuki.setInterval(function () { duration = moment.utc(duration - intervalDuration); if(duration.valueOf() <= 0) { clearInterval(interval); window.location.reload(); } else { $('#timer').text(duration.format("HH:mm:ss")); } }, intervalDuration); } return startTimer })();
Version data entries
18 entries across 18 versions & 1 rubygems