Out of office hours calculation

Issue 

Out of office hours calculation
 

Solution

var Today = new Date(); 
var DayNumber = Today.getDay(); 
var Hour = Today.getHours(); 
var Minute = Today.getMinutes();

[var_in_office] =  'n'

if ((DayNumber >=1 && DayNumber <= 5)  &&  (Hour >= 9 && Hour < 17)) // catches 9:00am til 5:00pm 
{
  [var_in_office] = 'y';
}


or

if ((mydate.getHours() < 7) || (mydate.getHours() == 7 && mydate.getMinutes() < 30) || (mydate.getHours() >= 21)) // catches 7:30am til 9:00pm
{
[var_inoffice] = 'n';
}
else
{
[var_inoffice] = 'y';
}