I am trying to add 120 days to a date when the user fills in a date field on a form. I have the code below which seems to work ok for dates in the middle of the year, but if the supplied date is near the end of the year, causing the year to roll over,
it seems to go completely wrong! Any ideas?
function SetRenewalDate(){ var CED = Xrm.Page.getAttribute("tbw_elecced").getValue(); var NewDate = new Date(); NewDate.setDate(CED.getDate()+120); Xrm.Page.getAttribute("tbw_stdate").setValue(NewDate); }