Javascript getMonth() and getDate transions issuse
<p>Hello i am trying to write the following function to display 7 days of the week</p>

<pre><code>function displaydates(){
// read the string output from the datepicker and
    //evalutes which date goes  into which cell

var date = document.getElementById("datepicker"); // Mon APR 30 2012 HH:MM:SS

var m = new Date(date.value);
var num = parseInt(m.getDate());
    var i = 0;
    var days=[];
    var x;
    for(i; i&lt;=6; i++){
        var day= m.setDate(num+i);
        var month = m.setMonth(m.getMonth());
        x = m.getMonth()+1 + "/" + m.getDate() + "&lt;br /&gt;";
        days.push(x);
    }
       document.getElementById("Monday").innerHTML= days[0];
       document.getElementById("Tuesday").innerHTML=days[1];
       document.getElementById("Wednesday").innerHTML=days[2];
       document.getElementById("Thursday").innerHTML=days[3];
       document.getElementById("Friday").innerHTML=days[4];
       document.getElementById("Saturday").innerHTML=days[5];
       document.getElementById("Sunday").innerHTML=days[6];
}
</code></pre>

<p>the code works fine as long as it's seven days before the next month.the problem i am having is when the user wants to see the next seven day the function outputs the wrong information
for example</p>

<pre><code>var m = new Date("Apr 30 2012"); / /monday
</code></pre>

<p>will make my function out put the following</p>

<p>4/29, 5/30, 7/1, 9/1, 11/2, 1/3, 3/7</p>

<p>again, this only happens on transition to the next month is there and thing i can do to make the month to month transition work in my function</p>
