var examination = new Date(DateField1.formattedValue);
var nextExam = new Date(new Date(examination).setMonth(examination.getMonth()+2));
I was wondering if this issue has ever been resolved? The code adds months correctly however, it does not calculate years e.g. one month added to 12/31/2011 should calculate as 01/31/2012. Your suggestion of using rawValue instead of formattedValue returns 01/00/0000 no matter what date is entered.
Hi, I'm not sure I understand the result required here. Wont 6 months on from 01/01/2010 be 01/07/2010, then 4 months be 11/01/2010 and another six months be 05/01/2011. Your desired results have gaps of 180 days, 93 days then 181 days.
Not sure why the script isn't working for you, maybe you should try Date.parse(DateTimeField1.rawValue). The rawValue will always be in yyyy-mm-dd format, where the formattedValue will vary depending on locale and display patterns.