2013-11-25 14:35:56 +00:00
|
|
|
function update_end()
|
|
|
|
{
|
2014-01-14 18:45:56 +00:00
|
|
|
var left;
|
|
|
|
if (typeof end_challenge === 'undefined')
|
|
|
|
left = 14400;
|
|
|
|
else
|
|
|
|
left = (end_challenge - new Date())/1000;
|
2013-11-25 14:35:56 +00:00
|
|
|
|
|
|
|
if (left < 0) left = 0;
|
|
|
|
|
|
|
|
var heure = Math.floor(left / 3600);
|
|
|
|
var min = Math.floor((left / 60) % 60);
|
|
|
|
var sec = Math.floor(left % 60);
|
|
|
|
|
|
|
|
$("#hours").html(( heure < 10 ? "0" : "" ) + heure);
|
|
|
|
$("#min").html(( min < 10 ? "0" : "" ) + min);
|
|
|
|
$("#sec").html(( sec < 10 ? "0" : "" ) + sec);
|
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
setInterval( function() {
|
|
|
|
update_end();
|
|
|
|
}, 1000);
|
|
|
|
});
|