【发布时间】:2015-01-08 06:46:28
【问题描述】:
我对 jquery 很陌生。我做了两个jquery日历。一个是出发日历,另一个是到达日历。当用户在第一个日历(出发)中选择日期时,下一个日历应隐藏出发日期之前的所有日期。示例:如果用户在出发日历中选择 1 月 13 日,则到达日历应自动隐藏 1 月 13 日之前的所有日期。我该如何实现这一点。我的日历代码如下。
jQuery("#datepickerarr").datepicker({
dateFormat: 'dd/mm/yy',
showOn: "both",
buttonImage: "images/calendar.png",
buttonImageOnly: true,
minDate:0,
maxDate: '+3M',
numberOfMonths:2,
buttonText:"click here to expand the calendar"
});
jQuery("#datepickerdepone").datepicker({
dateFormat: 'dd/mm/yy',
showOn: "both",
buttonImage: "images/calendar.png",
buttonImageOnly: true,
minDate:0,
maxDate: '+3M',
numberOfMonths:2,
buttonText:"click here to expand the calendar",
});
【问题讨论】:
-
您需要使用类似 jQuery("#datepickerarr").datepicker().minDate: new Date(2015, 1, 13) ;该日期将被选择的日期。
标签: javascript jquery html datepicker