tags:

views:

12

answers:

0

Hello everyone, I am using a jQuery datepicker control to capture the date a driver acquired his/her license. The problem I have is when supplying a year range of -100:-16 (one hundred years old starting 16 years ago), the control year selector behaves oddly. When selecting a year of 1978 for example, you will see 1878 selected in the control.

Below is the html you can use to reproduce this behavior.

var Input = document.createElement("input");
            $(document.body).append(Input);
            Input.type = "text";
            var YearRange = "-100:-16";

            $(Input).datepicker({
                changeMonth: true,
                changeYear: true,
                yearRange: YearRange,
                onClose: function(dateText, inst) {
                    var date = $(this).datepicker("getDate");
  alert(date);
                }
            });