Avi*_*vin 3 javascript jquery scheduled-tasks
我正在创建一个应用程序,在javascript该应用程序中,每个星期日的凌晨12.00发送通知。
那时候我该怎么做才能调用一个函数。
那话(喊着……)
function foo(){
var day =new Date().getDay();
var hours =new Date().getHours();
if (day === 0 && hours >12 && hours < 13) // day is a 0 index base
// sunday between 12:00 and 13:00
// Do what you want here:
}
setInterval(foo, 3600000); // one hour check.
Run Code Online (Sandbox Code Playgroud)
现场演示
?