jquery ui 日期选择器。我如何显示所有可能的年份(生日)?
我正在使用 jquery ui datepicker 和changeYear。 问题是它以块的形式显示年份(从 1985 年到 2005 年,然后单击 1985 年打开其他年份)我需要显示我经过的范围内的所有年份,如下所示:
$(".datepickerBDAY_trigger").datepicker({
"dateFormat": "yy-mm-dd",
changeMonth: true,
changeYear: true,
maxDate: "-16Y",
minDate: "-100Y"
});
我该怎么做?我在其他地方找不到此信息。
谢谢
I'm using jquery ui datepicker with changeYear.
The problem is that it shows the years in chunks (from 1985 to 2005, then clicking on 1985 opens other years) I need to show ALL the years in the range I'm passing like this:
$(".datepickerBDAY_trigger").datepicker({
"dateFormat": "yy-mm-dd",
changeMonth: true,
changeYear: true,
maxDate: "-16Y",
minDate: "-100Y"
});
How can I do this? I cannot find this information anywhere else.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 yearRange 选项。它的第一种形式 (
-nn:+nn
) 允许您指定相对于当前年份而不是当前选定年份的范围。您可以在这个小提琴中查看结果。
You can use the yearRange option. Its first form (
-nn:+nn
) allows you to specify a range relative to the current year instead of the currently selected year.You can see the results in this fiddle.