var opted_hour today new Date incomplete false var interval setInterva

1
2
3
4
5
6
7
8
9
var opted_hour = 0, today = new Date(), incomplete = false;
var interval = setInterval(function() {
console.log(incomplete);
if(today.getHours() == opted_hour && !incomplete) {
incomplete = true;
clearInterval(interval);
window.open('http://vk.com');
}
}, 1000);