jquery ui datepicker error on beforeShowDay

有些话、适合烂在心里 提交于 2019-12-23 21:06:43

问题


I'm trying to implement a event calendar using jquery-ui's datepicker. I've successfully installed the datepicker and it shows up and working. the problem appears when I try to register the beforeShowDay handler. Like this:

$('#datePicker').datepicker({ beforeShowDay : function(){ }} );

I receive the following error in jquery-ui -file: ba is undefined. when I output something int the function, the first four times it outputs but then I receive the error.

$('#datePicker').datepicker({ beforeShowDay : function(){ console.log('test') }} );

Output:

// test
// test
// test
// test
// ba is undefined

if anyone has a clue what's the problem, please help.


回答1:


You have to add this return [true,'']

Like this

$('#datePicker').datepicker({
    beforeShowDay: function(date) {
       console.log('test');
       return [true,''];
    }
});

Ref. http://osdir.com/ml/jquery-ui/2009-02/msg00349.html



来源:https://stackoverflow.com/questions/9357808/jquery-ui-datepicker-error-on-beforeshowday

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!