Sha256: 09ec8e6a7d8ac9f92b16f304dd41783ac07b62aceaa5b005ec289217e14f8f49
Contents?: true
Size: 645 Bytes
Versions: 14
Compression:
Stored size: 645 Bytes
Contents
var mumuki = mumuki || {}; (function (mumuki) { mumuki.startTimer = function (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); }; })(mumuki);
Version data entries
14 entries across 14 versions & 1 rubygems