//日期和日期(两种功能无法同时工作)
//show callback starting
答案 0 :(得分:0)
据我所知,您希望禁用日期格式为
的字符串数组中的某些日期 ['2015-12-01', '2015-12-02', '2015-12-03']
还要禁用某些条件的第一天(星期日)
尝试FIDDLE,
var disableddates = ['2015-12-01', '2015-12-02', '2015-12-03'];
function DisableSpecificDates(date) {
var datestring = jQuery.datepicker.formatDate('yy-mm-dd', date);
var disableDate = 0;
if ($.inArray(datestring, disableddates) != -1) {
disableDate++;
}
if (date.getDay() == 0) {
disableDate++;
}
if (disableDate > 0)
return [false];
else
return [true];
}
$(document).ready(function () {
$('#datepickerctrl').datepicker({
beforeShowDay: DisableSpecificDates
});
});
希望它适合你