0
I am trying to create a script so that one page redirects the user to another depending on the day of the week and the time. I found something, but it didn’t work:
` Function Checktime() {
var Saticdate = new Date(); var mdia = Saticdate.getDate(); var mdiasemana = Saticdate.getDay(); var mhora = Saticdate.getHours() var mminutos = Saticdate.getMinutes();
Else if(mdiasemana == 0) {
window.open("https://google.com");
}
Else if(mdiasemana == 4 && mhora >= 14 && mminutos >= 00 && mhora <= 15 && mminutos <= 05) {
window.open("https://apple.com/br");
}
Else if(mdiasemana == 4 && mhora >= 15 && mminutos >= 06 && mhora <= 16 && mminutos <= 45) {
window.open("https://microsoft.com");
}
Else { window.setTimeout("Checktime();", (60 * 1000)); } }
Checktime(); `