PDA

View Full Version : Datepicker bug with October 31


mrhattyhat
08-15-2006, 06:59 AM
Greetings all,

I wonder if anyone else has seen this. I have a calendar app that I'm developing which uses the datepicker to move between dates (obviously). The calendar rebuilds itself depending on the date selected. I won't get into details here, but check it out, you'll get the idea:

http://www.develigent.com/calendar/calendar.html

If you choose a date using the picker, that date is highlighted in the larger calendar. This works fine, except in the case of Oct. 31 under certain conditions: 1) choose any date in Sept. 2006 first, 2) then choose Oct. 31, 2006. You'll see that the date highlighted is actually Oct. 1, 2006. 3) now choose Oct. 31 and you'll get the correct result. I've done the debugging and it's not my event code, it's actually the date being passed from selecteddate.getDate() (it's passing 1 instead of 31).

Has anyone else seen this before? I'm not going to post code here right now because there's a lot to it, but if an admin asks for the code for debugging purposes, I'll post it. I'm mostly just wondering if anyone else has seen this or if it has been reported before.

Oh yeah...LPS 3.3.3

EvaF
08-16-2006, 05:52 AM
hi,
I have the same problem too. BTW try to choose
1) 28.2.2006
2) 31.3.2006

I still have some troubles, when i try to set attributes 'latestdate' and 'earliestdate' at runtime.
I solve this using showNextMonth(); showPreviousMonth();

...
<datepicker name="dpk" />
...
< method ...>
var d=new Date(2006,15,8);
dpk.setAttribute('latestdate',d);
dpk.showNextMonth();
dpk.showPreviousMonth();
</method>

but this solution is rather cumbersome ..