mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 12:09:21 +00:00
Block timer when it reach the end
This commit is contained in:
parent
0b87363d60
commit
2cc5539608
@ -28,6 +28,11 @@ ComunicWeb.components.countdown = {
|
||||
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);
|
||||
seconds_left = seconds_left % 86400;
|
||||
|
Loading…
Reference in New Issue
Block a user