Jquery 日期选择器,select 年
Jquery datepicker, select year
我希望有超过 11 个日期可供选择,但我希望在一个下拉列表中包含所有可能的年份
这是我的代码:
$( function() {
$( "#data" ).datepicker({
changeMonth: true,
changeYear: true,
minDate: "-100Y",
maxDate: "-18Y"
});
} );
我想要从 1917 年到 1999 年的完整选择
试试这个:
$(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" />
我希望有超过 11 个日期可供选择,但我希望在一个下拉列表中包含所有可能的年份
这是我的代码:
$( function() {
$( "#data" ).datepicker({
changeMonth: true,
changeYear: true,
minDate: "-100Y",
maxDate: "-18Y"
});
} );
我想要从 1917 年到 1999 年的完整选择
试试这个:
$(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" />