I am putting an easter egg into my program that causes a jack-o-lantern image to appear on Halloween, but I cannot get the code to recognize October 31st as a month/day. When I do a console.log on my code, it feeds back "Mon Oct 30 2017" instead of the 31st.
var today = new Date();
var halloween = new Date(today.getFullYear() + '10-31');
console.log(halloween.toDateString());
console.log(today.toDateString());
if (today.toDateString() === halloween.toDateString()) {
printedMsg.innerHTML = rewardMsg + 'You deserve a spooky treat! ' +
'<img src="https://preview.c9users.io/mkrul/color_project/reward-imgs/boo.jpg">';
}
EDIT: I put the missing hyphen in front of '-10-31', but the console is still showing me "Mon Oct 30 2017"
var halloween = new Date(today.getFullYear() + '-10-31');