javascript date of last day of previous month
<p>Let's say I have 3 variables like this:</p>

<pre><code>var Month = 8; // in reality, it's a parameter provided by some user input
var Year = 2011; // same here
var FirstDay = new Date(Year, Month, 1);
</code></pre>

<p>Now I want to have the value of the day before the first day of the month in a variable. I'm doing this:</p>

<pre><code>var LastDayPrevMonth = (FirstDay.getDate() - 1);
</code></pre>

<p>It's not working as planned. What the right of doing it?</p>

<p>Thanks.</p>
