मैं एक समारोह है कि एक विशिष्ट समय और दिन में मेरा पेज ताज़ा करता है, लेकिन कैसे मैं एक निश्चित समय पर एक विशिष्ट महीने और तारीख को ही ताज़ा कर सकते हैं? कारण है कि मैं ऐसा करना चाहते है, क्योंकि फुटबॉल स्थानान्तरण पर अपडेट के लिए मेरी वेबसाइट जांच करता है कि केवल विशिष्ट महीने पर होती है।
यहाँ एक दिन में निश्चित समय के ताज़ा करने के लिए मेरी समारोह है
function refreshAt(hours, minutes, seconds, day) {
var now = new Date();
var then = new Date();
var dayUTC = new Date();
if(dayUTC.getUTCDay() == day) {
if(now.getUTCHours() > hours ||
(now.getUTCHours() == hours && now.getUTCMinutes() > minutes) ||
now.getUTCHours() == hours && now.getUTCMinutes() == minutes && now.getUTCSeconds() >= seconds) {
then.setUTCDate(now.getUTCDate() + 1);
}
then.setUTCHours(hours);
then.setUTCMinutes(minutes);
then.setUTCSeconds(seconds);
var timeout = (then.getTime() - now.getTime());
setTimeout(function() { window.location.reload(true); }, timeout);
}
}