title: Set a specific date and year in a MS CRM date time field in the onchange event
body: <p>I have two date time fields.
  In the first field, if the date is set, then in the second date time field, the date should be automatically populated
  with this format.</p>
  
  <p><strong>For example</strong>:</p>
  
  <p><strong>Start date</strong>: 1: 09/30/2016</p>
  
  <p><strong>End date 2</strong>: 09/29/2017.</p>
  
  <p><strong>Following is my code:</strong></p>
  
  <pre><code>function SetOneplusyearminus1date() {
  debugger;
  var start = Xrm.Page.getAttribute("msdyn_startdate").getValue();
  if (start != null)
  {
      var endYear = start.setYear(start.getFullYear() + 1);
      Xrm.Page.getAttribute("msdyn_enddate").setValue(endYear);
  }}
  </code></pre>
  
  <p>I have set the year but unable to set the Date.
  So please help me with your suggestions.</p>