我添加到页面的 jQuery 日期选择器在 IE 9 和 Firefox 18 中按预期工作,但在 Google Chrome 24 中选择日期后不会关闭。
这是我正在使用的 jQuery 代码:
$(function() {
$( "#fromCheck" ).datepicker({
defaultDate: "-1w",
maxDate: "+0",
changeMonth: true,
numberOfMonths: 1,
showButtonPanel: false,
onClose: function( selectedDate ) {
$( "#toCheck" ).datepicker( "option", "minDate", selectedDate || "-1w" );
}
});
$( "#toCheck" ).datepicker({
defaultDate: "+0",
maxDate: "+0",
changeMonth: true,
numberOfMonths: 1,
showButtonPanel: false,
onClose: function( selectedDate ) {
$( "#fromCheck" ).datepicker( "option", "maxDate", selectedDate || "+0" );
}
});
$( "#fromCard" ).datepicker({
defaultDate: "-1w",
maxDate: "+0",
changeMonth: true,
numberOfMonths: 1,
showButtonPanel: false,
onClose: function( selectedDate ) {
$( "#toCard" ).datepicker( "option", "minDate", selectedDate || "-1w" );
}
});
$( "#toCard" ).datepicker({
defaultDate: "+0",
maxDate: "+0",
changeMonth: true,
numberOfMonths: 1,
showButtonPanel: false,
onClose: function( selectedDate ) {
$( "#fromCard" ).datepicker( "option", "maxDate", selectedDate || "+0" );
}
});
});
这是演示页面的链接: