- 2 months ago 26
jQuery Question

jQuery UI: Datepicker set year range dropdown to 100 years

Using the Datepicker the year drop down by default shows only 10 years. The user has to click the last year in order to get more years added.

How can we set the initial range to be 100 years so that the user will see a large list by default?

enter image description here

function InitDatePickers() {
changeMonth: true,
changeYear: true,
showButtonPanel: true,
maxDate: '@maxDate',
minDate: '@minDate'


You can set the year range using this option per documentation here

yearRange: '1950:2013', // specifying a hard coded year range

or this way

yearRange: "-100:+0", // last hundred years