The project needs to be used, wrote one of their own. JavaScript date monthly plus minus
<! DOCTYPE html>functiondatetodate (date) {varSdate =NewDate (); if(typeofDate = = ' object ' &&typeof NewDate (). GetMonth = = "function") {sdate=date; } Else if(typeofDate = = "string") { vararr = Date.split ('-') if(Arr.length = = 3) {sdate=NewDate (Arr[0] + '-' + arr[1] + '-' + arr[2]); } } returnsdate; } functionaddmonth (date, num) {num=parseint (num); varSdate =datetodate (date); varSyear =sdate.getfullyear (); varSmonth = Sdate.getmonth () + 1; varSday =sdate.getdate (); varEyear =syear; varEmonth = Smonth +num; varEday =Sday; while(Emonth > 12) {eyear++; Emonth-= 12; } varEDate =NewDate (Eyear, eMonth-1, Eday); while(Edate.getmonth ()! = EMonth-1) {Eday--; EDate=NewDate (Eyear, eMonth-1, Eday); } returneDate; } functioncalcdate () {varD = document.getElementById (' Date '). Value; varn = document.getElementById (' num '). Value; varEDate =Addmonth (d, N); document.getElementById (' Result '). InnerHTML = edate.getfullyear () + '-' + (Edate.getmonth () + 1) + '-' +edate.getdate (); } </script>JavaScript Date month plus minus