[if IE 9] [endif]
I believe that this should accomplish what you'd like to.
var dt = new Date();
var w = dt.getDay();
var h = dt.getHours();
var m = dt.getMinutes();
var isAvailable = (w >= 1 && w <= 5) && ((h === 9 && m >= 45) || (h>9 && h<16) || (h === 16 && m <=45));
is w greater or equal to 1 && also lesser than or equal to 5?
and is either -
h exactly equal to 9 && m greater or equal to 45?
h greater than 9 && also lesser than 16?
h exactly equal to 16 && m lesser than or equal to 45?
Hi. Thank you for replying. What I'm wanting to do is show the panels based on the Boolean result but I'm having an issue with the syntax for that.
have a look here how could you easily check for a time range within a day with a rule
it could easily be extend by check for a workday using formatDate() function, have a look here for a proper format string
how about you use a rule on that panel to show/hide it? In your JS validation you could set the value of some hidden field and use this value inside your rule to decide whether to show or hide the panel.