I tried to populate my <select> field with weekending dates,
and found that it work fine until 04/11/2004. You may also try this:
=========================================================
sunday = new Date(2004, 3, 11);
sunday.setTime(sunday.getTime() - (6 * 86400000));
alert(sunday);
sunday = new Date(2004, 3, 11);
sunday.setTime(sunday.getTime() - (7 * 86400000));
alert(sunday);
=========================================================
I got Monday apr 5 2004 and Saturday apr 3 2004.
Where is the Sunday apr 4 2004?
Is anybody knows what is special about this date?
and found that it work fine until 04/11/2004. You may also try this:
=========================================================
sunday = new Date(2004, 3, 11);
sunday.setTime(sunday.getTime() - (6 * 86400000));
alert(sunday);
sunday = new Date(2004, 3, 11);
sunday.setTime(sunday.getTime() - (7 * 86400000));
alert(sunday);
=========================================================
I got Monday apr 5 2004 and Saturday apr 3 2004.
Where is the Sunday apr 4 2004?
Is anybody knows what is special about this date?