javascript - How do I modify setDate to getFullYear less 1 day? -
i not finding way modify end date warranty 1 full year less day. here code if can or point me right post answer? here function have now.
function setstdwarrenddate(date) { var stddate = $.datepicker.parsedate('mm/dd/yy', date); stddate.setfullyear(stddate.getfullyear() + 1); $('#stdwarrantyenddate').val($.datepicker.formatdate('mm/dd/yy', stddate )); }
use:
stddate.setfullyear(stddate.getfullyear() + 1); stddate.setdate(stddate.getdate() - 1);