title: Add days, weeks, months to date using jQuery
body: <p>I have a form which lets the user select an invoice date and payment terms. The payment terms are; 1 week from invoice date, 4 weeks from invoice date, 1 month from invoice date, etc.</p>
  
  <p>When the user has selected an invoice date and the payment terms I then want to generate the invoice due date.</p>
  
  <p>My question is, how do I add to a date in jQuery and how do I do it in a reliable way. For example, taking into account leap years and the varying number of days in each month. For example, adding 1 month to October 31st should be November 30th and not November 31st.</p>
  
  <p>I have found a few solutions by searching Google but they seem to fail on leap years, etc.</p>