javascript - How to sum days to some date -


I have an input with some date values ​​and I want to add an amount of 60 days to that value, I want to put it in. How can I go about doing this?

The first input is 2012-12-17 and the second input is 2013-02-15

   & Lt; Td> & Lt; Input Name = "Endiod Experience" id = "Endiodial Expression" type = "Text" Read Only = "Reading" and gt; & Lt; / Td> $ (Document) .ready (function () {$ ('# USER_joindate'). ('Change', function () {.... magic ...})}};  
Download moment.js from

and try it:

  $ (document). Validate the date format within $ ('' '' change ', function () {// USER_joindate var valueString = $ (this) .val (); // USER_joindate on $ (' ready ',' $ USER_joindate '). (DateString.match (/ ^ [0-9] {2} - [0-9] {2} - [0-9] {4} $ / g)) {// moment.js var dateObj = moment (dateString ); Create a new date object; // add the date to obj.ed (60, 'days') for 60 days; // fill the end period, new wire $ ("#Andperiod Expence") .val (dateObj.format ("YYYY-MM-DD"));}});});  

Comments