December Missing from jQuery UI Date Picker

November 16, 2011

We encountered a problem with the jQueryUI datepicker. We had the following code:

$(function() {
    $( "#datepicker" ).datepicker({
        maxDate : 0,
        changeMonth : true,
        changeYear : true,
        yearRange : '-100:-18'
    });
});

and if the date picker was opened without a date in the field, December was missing. Wierd.

The problem was tracked down to maxDate. With maxDate as 0, the date picker allows moving back within the months using the arrows, not forwards, and month droplist doesn't contain December. Removing maxDate sorted the problem out.

Tags: jqueryui jquery ui