beforeShowDay上的jquery ui datepicker错误

我正在尝试使用jquery-ui的datepicker实现事件日历。 我已成功安装了datepicker,它显示并正常工作。 当我尝试注册beforeShowDay处理程序时出现问题。 像这样:

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

我在jquery-ui -file中收到以下错误: ba is undefined 。 当我在函数中输出一些内容时,它输出的前四次然后我收到错误。

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

输出:

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

如果有人知道问题是什么,请帮忙。

你必须添加这个return [true,'']

像这样

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

参考。 http://osdir.com/ml/jquery-ui/2009-02/msg00349.html