Question

please tell me how to set the range jqueryUi datepicker to select year 1950-2014.

my settings set the range of choice year 2013-2024:

$(".datepicker").datepicker({
dateFormat: 'yy-mm-dd',
changeMonth: true,
changeYear: true,
minDate: "-220",
});

I just tried these options:

minDate: -2200000,       2004-2024
minDate: -22000,       2004-2024
minDate: -2200000,       2013-2024
minDate: 2200,       2020-2030
minDate: 22000,       2074-2084
Was it helpful?

Solution

yearRange: '1950:2014',
minDate: new Date(1950, 0, 1),
maxDate: new Date(2014, 0, 1)

Note that you can also use maxDate to explicitly specify the upper bound.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top