我做了一个内联datepicker,我只有1个问题。 我无法执行beforeShowDay选项bootstrap 3 datepicker inline beforeShowDay问题
我使用PHP从数据库中加载数组。我用AJAX
实现这个代码:
$(document).ready(function() {
var ajax = $.ajax({
url : "dates.php",
data : "action=showdates",
dataType : "json"
});
ajax.complete(function(calendarEvents) {
$("#inline").datepicker({
beforeShowDay : ShowDay()
});
function ShowDay(date) {
console.log('function showday');
for (var i = 0; i < calendarEvents.length; i++) {
var jaar = calendarEvents[i].slice(0,4);
console.log(jaar);
}
console.log('showday');
}
});
});
的麻烦,我有个大气压的是,我想对某些天预约。 我希望在预约时使用return [true, "classname", ""]
,在所有其他日期使用return [true, "", ""]
。我希望我能得到一些帮助!
这就是我要做的:http://www.emirplicanic.com/javascript/jquery-ui-highlight-multiple-dates-in-jquery-datepicker
的问题是,我的日期选择器是内联,所以我不能直接实现进入beforeShowDay: function(date) { }
PLS发布的演示上的jsfiddle或类似的东西,它将不胜感激= d
* BTW我试着给beforeShowDay: ShowDay
但这并不调用函数