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.
When the user has selected an invoice date and the payment terms I then want to generate the invoice due date.
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.
I have found a few solutions by searching Google but they seem to fail on leap years, etc.