我正在使用 Timepicker 插件:http ://trentrichardson.com/examples/timepicker/ 。我想在日期更改后更新时间限制。这是我的代码:
var date = "10/02/2013"; // October, 02 2013
var time = "22:05";
$("#Date").datepicker({
minDate: 'today',
maxDate: date,
showOn: "button",
buttonImage: '@Url.Content("~/Images/Library/Calendar.png")',
buttonImageOnly: true,
onSelect: function (dateText) {
if (Date.parse(dateText) == Date.parse(date)) {
$('#Time').timepicker({
hourMax: time.split(':')[0],
minuteMax: time.split(':')[1]
});
}
else {
$('#Time').timepicker({
hourMax: 23,
minuteMax: 59
});
}
}
});
我尝试这样做,但它不起作用