title: Error while trying to add days to a date with JavaScript
body: <p>I wrote the following script to add days to a given date:</p>
  
  <pre><code>$("#rec_days").change(function(){                    
      var start_date = new Date($("#start_date").attr('value'));                                    
      var rec_days = $("#rec_days").attr('value');
      var end_date = new Date(start_date).setDate(start_date.getDate() + rec_days); 
      $("#end_date").val(end_date.getFullYear() + '-' + end_date.getMonth() + '-' . end_date.getDate());                                    
  }); 
  </code></pre>
  
  <p>Console logs the following error: "TypeError: end_date.getFullYear is not a function".</p>
  
  <p>The input date is YYYY-MM-DD and I would like for the output date to be in the same format.</p>
  
  <p>What am I doing wrong?</p>