Hey all this is the array I have so far:
var thisDayDate = today.getDate();
var JANDays = [{day:16, timeStart:"23:00:00", timeEnd:"23:59:59"}, //It's Jan 16th Friday 11pm to
{day:17, timeStart:"00:00:00", timeEnd:"11:00:00"}, //It's Jan 17th Sat 11am
{day:22, timeStart:"23:00:00", timeEnd:"23:59:59"}, //It's Jan 22nd Friday 11pm to
{day:23, timeStart:"00:00:00", timeEnd:"07:00:00"}]; //It's Jan 23ed Sat 7am
for(var i = 0; i < JANDays.length; i++)
{
if (thisDayDate == [JANDays[i].day]) {
if (isSiteDown(JANDays[i].timeStart,JANDays[i].timeEnd)) {
showThePage();
} else {
console.log('nope');
}
}
}
My issue is that I am only wanting to do this for the array:
var JANDays = [{day:16, timeStart:"23:00:00"}, //It's Jan 16th Friday 11pm to
{day:17, timeEnd:"11:00:00"}, //It's Jan 17th Sat 11am
{day:22, timeStart:"23:00:00"}, //It's Jan 22nd Friday 11pm to
{day:23, timeEnd:"07:00:00"}]; //It's Jan 23ed Sat 7am
In the above code I am wanting just to have a timeStart for the first day and an timeEnd for the second day etc etc.
The timeEnd for the 1st day should be static at 23:59:59
The timeStart for the 2nd day should be static at 00:00:00
I am not sure how to go about doing that in my IF statement loop so help would be appreciated.