I have now the following code:
var d = new Date();
var curr_hour = d.getHours();
var curr_minute = d.getMinutes();
var curr_time = curr_hour + ":" + curr_minute;
var open_time = "17:00";
if(Date.parse ( curr_time ) > Date.parse ( open_time )){
alert("Webshop is open");
} else {
alert("Webshop is closed.");
}
What the code should do is.. if the current time is greater then 17:00 send the alert and if not, send the other alert.. All i get now is that it is closed.
You don’t need all that parsing, you already know
getHours()method!…that’s it!