title: Adding days to given date in jQuery
body: <p>I have a form with three fields, "start_date", "days", "end_date". I would like to get the end date by adding days to the start date. </p>
  
  <p>My jQuery code is:</p>
  
  <pre><code>$("#days").change(function(){
    var start_date = new Date($("#start_date").attr('value'));
    var days = parseInt($("#days").attr('value'))-1;
    var end_date = new Date(start_date);
    end_date.setDate(start_date.getDate() + days);                            
    $("#end_date").val(end_date.getFullYear() + '-' + ("0" + (end_date.getMonth() + 1)).slice(-2) + '-' + ("0" + end_date.getDate()).slice(-2));
  });
  </code></pre>
  
  <p>In the "end_date" field I get "NaN-aN-aN". </p>
  
  <p>What am I doing wrong?</p>