Datepicker short-cuts don't always work

Datepicker short-cuts don't always work

Hi,

I am experiencing some weird behaviour with the datepicker when using the short-cuts to change the date. It allows me to change the date as in that it highlights the correct days, but when clicking enter it won't change the date in the input field, when:

- I have set a default date using the value attribute in the input field where the datepicker is tied too

<input type="text" id="Date" value="some correctly formatted date" /> 

- Or I set the date using the datepicker API

        $(datePropertyName).datepicker("disable");
        $(datePropertyName).datepicker('setDate', Date.parse("some correctly formatted date"));
        $(datePropertyName).datepicker("enable"); 

Btw this seems very weird to have to do this, but it was the only way I could get it to work and have the selected date in the input box visible.

- And when selecting a date that is within the same month but in the future of the date provided by either one of these previous methods. Changing to another month fixes the issue, selecting a date that lies before the provided date also works just fine.

So if I provide the date 23.02.2010 then I can use the keys to select 24.02.2010 but when hitting enter nothing happened. Selecting 22.02.2010 will work. 

And when using the mouse it always works!

This is my datepicker setup:

$(datePropertyName).datepicker();
        
        $(datePropertyName).datepicker('option', {
            dateFormat: "dd.mm.yy",
            onSelect: function(dateText, inst) { $("#" + propertyName).val($(datePropertyName).val() + ' ' + $(timePropertyName).val()); }
        });

The onSelect basically combines a time fiend and the date field.

I hope this is enough of an explanation.

Cheers,

-Mark