开发者

How restrict the year in jquery datepicker?such that it display no year other than current year in database

开发者 https://www.devze.com 2022-12-30 18:24 出处:网络
How to set jquery.datepick.js to display only the current year开发者_开发百科 in the database?If it is the datepicker from JQuery UIyou can give it min and max date as arguments like this:

How to set jquery.datepick.js to display only the current year开发者_开发百科 in the database?


If it is the datepicker from JQuery UI you can give it min and max date as arguments like this:

$('#datepicker').datepicker({
    minDate: new Date(2010, 1 , 1), 
    maxDate: new Date(2010,12,31)
});

Hope this helps you


Hai change the year range from yearRange: '-99:+100', To yearRange: '-1:+100',so that we can get the dates from the year before current year say the dropdown will display the year starting from 2009 since the current year is 2010

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号