I am trying to see if my JavaScript file's function is written correctly in order to display "Sunday, December 24, 2006". So here is the function:
function XmasDays(thisDate) {
var XMYear = thisDate.getFullYear();
var XMDay = new Date("December, 25, 2005");
XMDay.setFullYear(XMYear);
var dayTotal = (XMDay-thisDate)/(1000*60*60*24);
dayTotal = Math.round(dayTotal);
return dayTotal;
}
I've tested the following:
var XMYear=thisDate.getFullYear();
var XMDay=new Date("December, 25, 2005");
XMDay.setFullYear(XMYear);
and they output the correct information to my web page but I can't seem to figure out if the following three are written correctly can you help me see if any of these are in error? Thanks!!
var dayTotal=(XMDay-thisDate)/(1000*60*60*24);
dayTotal=Math.round(dayTotal);
return dayTotal;
If you have any questions please ask. Thanks so much for any and all help!