title: "a.getFullYear is not a function" when trying to get date difference
body: <p>I'm trying to get a date difference between a date and today with JS.
  Here is my code, but I get "a.getFullYear is not a function".</p>
  
  <pre><code>var brbr = '&lt;br&gt;&lt;br&gt;';
  var duedate="2015-11-06";
  document.write(duedate);
  document.write(brbr);
  
  // Today's date:
  var today = new Date();
  var dd = today.getDate();
  var mm = today.getMonth()+1; //January is 0!
  var yyyy = today.getFullYear();
  
  if(dd&lt;10) {
      dd='0'+dd
  } 
  
  if(mm&lt;10) {
      mm='0'+mm
  } 
  today = yyyy+'-'+mm+'-'+dd;
  document.write(today);
  document.write(brbr);
  
  // DIFFERENCE 2 dates:
  var _MS_PER_DAY = 1000 * 60 * 60 * 24;
  
  
  // a and b are javascript Date objects
  function dateDiffInDays(a, b) {
      // Discard the time and time-zone information.
      var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());
      var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());
      return Math.floor((utc2 - utc1) / _MS_PER_DAY);
  }
  </code></pre>
  
  <p>Result:     </p>
  
  <pre><code>var days_left = dateDiffInDays(today, duedate);
  document.write(days_left);
  document.write(brbr);
  </code></pre>