How does this "days in month" function work?
<pre><code>  function GetDaysInMonth(month, year) 
  {
      return 32 - new Date(year, month, 32).getDate();
  }
</code></pre>

<p>Ok, I don't see what this is doing specifically, this part:</p>

<pre><code> new Date(year, month, 32).getDate();
</code></pre>

<p>I know what <code>getDate()</code> does, but then I looked up <code>Date</code> in JavaScript but in this particular example, I don't see why you'd pass 32 here. How can this be returning the number of days in whatever month and year you're passing to it?</p>
