X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=js%2F90-timers.js;h=d439299ebe6d562f3d47cab5883f4f986589ce34;hb=b0b9b0278598ba852c4c82fef94b264766d9cb50;hp=7281f6f3fd689a9d37c364ff335886660802038f;hpb=7093e9ba00cf7727a52a49d34d4df12e4f865dd4;p=plack-app-gruntmaster.git diff --git a/js/90-timers.js b/js/90-timers.js index 7281f6f..d439299 100644 --- a/js/90-timers.js +++ b/js/90-timers.js @@ -13,9 +13,9 @@ function update_timer(timer){ value = Math.max(value * 3 / 10, value * left / total); timer.innerHTML = Math.floor(value); } else { - var hours = left / 60 / 60; + var hours = Math.floor(left / 60 / 60); hours = hours < 10 ? '0' + hours : hours; - var minutes = left / 60 % 60; + var minutes = Math.floor(left / 60) % 60; minutes = minutes < 10 ? '0' + minutes : minutes; var seconds = left % 60; seconds = seconds < 10 ? '0' + seconds : seconds; @@ -23,9 +23,7 @@ function update_timer(timer){ } } -$(function() { - $('.timer').each(function(item){ - update_timer(item); - setInterval(function(){update_timer(item)}, 1000); - }); -}); +$(() => $('.timer').each(item => { + update_timer(item); + setInterval(() => update_timer(item), 1000); +}));