最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jquery ui datepicker error on beforeShowDay - Stack Overflow

programmeradmin0浏览0评论

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.

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.

Share Improve this question asked Feb 20, 2012 at 7:56 HeadshotaHeadshota 21.4k13 gold badges62 silver badges82 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 10

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

Like this

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

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

发布评论

评论列表(0)

  1. 暂无评论