If I have a date of May 31, 2014, then if I say date.setMonth(date.getMonth() + 1) to get to the next month, I get July 01, 2014. I would expect to get June 30, 2014. I guess it's because June doesn't have 31 days so JavaScript does it best to avoid errors. 

I wrote a special function to actually do the setDate, setMonth and setYear functions on that date object based on calculations. Seems like the setMonth alone doesnt do the right thing.

Ideas,

David