jQuery日期选择器minDate不工作
我预计以下日期范围将从65年前开始,到18年前结束。相反,minDate数字被忽略,并设置为截止日期前10年。无论我在minDate中把什么作为价值都没有区别jQuery日期选择器minDate不工作,jquery,jquery-ui,datepicker,mindate,Jquery,Jquery Ui,Datepicker,Mindate,我预计以下日期范围将从65年前开始,到18年前结束。相反,minDate数字被忽略,并设置为截止日期前10年。无论我在minDate中把什么作为价值都没有区别 $(function() { $("#datepicker").datepicker({ changeMonth: true, changeYear: true, minDate: "-65y", maxDate: "-18y" }); }); 这对我有用
$(function() {
$("#datepicker").datepicker({
changeMonth: true,
changeYear: true,
minDate: "-65y",
maxDate: "-18y"
});
});
这对我有用
$("#txt_birthdate").datepicker({
yearRange: "-100:-18",
changeMonth: true,
changeYear: true,
maxDate: new Date()
});
您可以使用该选项
$('#datepicker').datepicker({
changeMonth: true,
changeYear: true,
yearRange: "-65y:-18y"
});
. 年份选择菜单仅显示当前选择的+/-10年,但您可以多次选择,以进一步返回到指定的65年。谢谢,但我确实需要在年份下拉列表中显示整个范围,而不仅仅是10年。有什么想法吗?这就是我想要的答案,非常感谢。我所需要做的就是设定一个年范围。我只是被datepicker网站“帮助”部分给出的示例弄糊涂了,我以为您必须指定年份,但不知道它可以是基于今天日期的灵活范围集。如果我问问题时不清楚,向所有人道歉!