```
//date: yyyy[sep]MM[sep]dd
function getNextMonthDay(date, monthNum, sep) {
var dateArr = date.split(sep);
var year = dateArr[0]; //获取当前日期的年份
var month = dateArr[1]; //获取当前日期的月份
var day = dateArr[2]; //获取当前日期的日
var year2 = year;
var month2 =parseInt(month) +parseInt(monthNum);
if (month2 >12) {
year2 =parseInt(year2) +parseInt((parseInt(month2) /12 ==0 ?1 :parseInt(month2) /12));
month2 =parseInt(month2) %12;
}
var days2 =new Date(year2, month2, 0);
days2 = days2.getDate();
if (day < days2) {
days2 = day;
}
if (month2 <10) {
month2 ='0' + month2;
}
var t2 = year2 + sep + month2 + sep + days2;
return t2;
}
```