mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-12-24 18:08:50 +00:00
Block timer when it reach the end
This commit is contained in:
parent
0b87363d60
commit
2cc5539608
@ -27,6 +27,11 @@ ComunicWeb.components.countdown = {
|
||||
// find the amount of "seconds" between now and target
|
||||
var current_date = parseInt(new Date().getTime() / 1000);
|
||||
var seconds_left = time_end - current_date;
|
||||
|
||||
if(seconds_left < 0) {
|
||||
seconds_left = 0;
|
||||
clearInterval(interval);
|
||||
}
|
||||
|
||||
// do some time calculations
|
||||
days = parseInt(seconds_left / 86400);
|
||||
|
Loading…
Reference in New Issue
Block a user