简体   繁体   中英

jquery ui datepicker error on beforeShowDay

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM