Can't set date range for Jquery UI calendar
I am having problems getting my head around the syntax to set the date range for the JqueryUI calendar.
this...
$(function() {
$('#DOB').datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'd MM yy',
minDate: new Date(1900, 11 - 1, 6)
});
});
is strangely giving me a range o开发者_JS百科f the years 2000 - 2020. ALl I want to do is start at 1900. End date can be today.
The default yearRange shows +10 and -10 years from the current date (hence why you see 2000 to 2020)
Try adding:
yearRange: '1900:2010'
to display the years 1900 to 2010 in the year drop-down.
$(function() {
$('#DOB').datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'd MM yy',
minDate: new Date(1900, 11 - 1, 6),
yearRange: '1900:2010'
});
});
if you choiced dateFormat: 'd MM yy' and range from 1900 to 20* you get the conflict with this values: "1 February, 10" - is it "01.02.1910" or "01.02.2010"? May be, if you change the dateFormat the problem would disappeared
精彩评论