[英]Jquery datepicker, select year
I would like to have more than 11 dates to choose from, instead I'd like to have all possible years in one single dropdown 我希望有11个以上的日期可供选择,相反,我希望将所有可能的年份都放在一个下拉菜单中
This is my code: 这是我的代码:
$( function() {
$( "#data" ).datepicker({
changeMonth: true,
changeYear: true,
minDate: "-100Y",
maxDate: "-18Y"
});
} );
I would like to have full selection from 1917 to 1999 我希望从1917年到1999年有完整的选择
Try this : 尝试这个 :
$(function() { $("#data").datepicker({ changeMonth: true, changeYear: true, yearRange: "-100:-18" }); });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> <input type="text" id="data" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.