How to get 30 days prior to current date?
<p>I have a start calendar input box and a end calendar input box. We want defaults start calendar input box 30 days prior to current date and the end calendar input box to be the current date. Here is my date vars.</p>

<pre><code>var today = new Date(),
    dd    = today.getDate(),
    mm    = today.getMonth(),
    yyyy  = today.getFullYear(),
    month = ["January", "February", "March",
        "April", "May", "June", "July", "August",
        "September", "October" "November", "December"],
    startdate = month[mm] + ", " + yyyy.toString();
</code></pre>

<p>The end date would be something like <code>var enddate = startdate - 30;</code> Obviously this won't work.</p>

<p>So if the current date is December 30, 2011 I'd want the start date to read December 1, 2011.</p>

<p>EDIT: My question was answered... sort of. Date.today(); and Date.today().add(-30); work but I need the date in the format of January 13, 2012. Not Fri Jan 13 2012 10:48:56 GMT -055 (EST). Any help?</p>
