http://jsfiddle.net/7vzapm49/1/
var startdatearr = [new Date("04 Dec 2014 14:30:00").toUTCString(), new Date("07 Dec 2014 14:30:00").toUTCString()];
var enddatearr = [new Date("05 Dec 2014 14:30:00").toUTCString(), new Date("08 Dec 2014 14:30:00").toUTCString()];
var d = new Date().toUTCString();
for (i = 0; i < startdatearr.length; i++) {
if (startdatearr[i] <= d && d <= enddatearr[i]) {
alert("true");
} else {
alert("false");
}
}
This code snippet previously functioned correctly, but now it seems to be malfunctioning. Even though today's date falls within the specified range of 4th and 5th December 2014 in UTC, it returns false.
Could this issue be related to the month of December, or is the code using outdated methods?