I need some help with javascript dates. I have found a bug when I was working. I think that it has been solved but I don't know why.
We have a custom calendar with seven days each pages (monday-sunday). When you pick next (>) it add 7 days. The trouble was that in october 2015 (19-25) when you pressed next, it becomes a new week with days between 25-31 instead of 26-1 week.
This was the code that sum one week:
date = new Date( date.getTime() + num * 86400000 );`
And this is how I "fix" it:
date = new Date(date.getFullYear(), date.getMonth(), date.getDate() + num);`
Now the picker is working, I suppose 86400000 are the milliseconds in a day but why it doesn't work for some days?
Thanks