I currently have the following script:
<script>
if(new Date().getHours() > 17 || (new Date().getHours() == 17 &&
new Date().getMinutes()== 0 && new Date().getSeconds() == 0) &&
(new Date().getHours() < 21 && new Date().getMinutes() < 30
&& new Date().getSeconds() == 0)){
//do nothing.
} else {
$(document).ready(function() {
$(".inline").colorbox({inline:true, open:true, width:"50%"});
});
}
So basicly what stand in the if:
If the time is 17:00 till 21:30, do nothing, or else display the box. But what happends is that the box stops working around 18:00 and starts working at midnight again.. Someone see whats wrong here?
1 Answer