jQuery's datepicker allows you to highlight dates using the BeforeShowDay callback.
Is it possible to pass a second parameter to the method?
$(selector).datepicker({beforeShowDay: selectedDay});   
function selectedDay(date) {
    // Do stuff
    return [true, 'class_name'];
}
As you can see, the parameter date is automatically passed to the selectedDay method, thus making me unsure as to how to pass a second parameter.
Cheers.
function selectedDay(date, param ) {
     // Do stuff with param
     return [true, ''];
}
function doStuff(){
    var param = "param_to_pass";
    $(selector).datepicker({
        beforeShowDay: function (date){
            return selectedDay(date, param );
        }
    }); 
}  
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With