Hi Team,
This is my first post to this site and in fact any Javascript site. I have a problem which is strange, well strange to me anyway.
I have a grid on a form that displays all of the days in the week for a particular week ending date (Sunday). To calculate which date is the week ending (Sunday) for the next week I do the following:
var weekEndingParts = table.rows[7].cells[0].innerText.split("/");
var weekEnding = new Date(weekEndingParts[2], weekEndingParts[1] -1, weekEndingParts[0]);
nextWeekEnding = new Date(weekEnding.valueOf() + (7 * 86400000));
The works famously until it gets to two months .. October 2006 and Aril 2007. The only thing I can determine is different about these months is that they both have the 1st of the month on a Sunday.
Even stranger is that if I set the date at October 28th 2006 and simply add 86400000 to it the date jumps to October 30th 2007. October 29th seems to be totaly skipped.
Any ideas?
My only thought is that it's some environmental date setting that I am unaware of.
I look forward to your replies.
Cheers,
Danny