Skip to content Skip to sidebar Skip to footer

How To Highlight Specific Dates In The Datepicker

How to Highlight in BOLD specific dates in the datepicker? I have the array with dates var datesArray = new Array(); I know that I need to use beforeShowDay: method, but I can't fi

Solution 1:

Yes you need to use beforeShowDay event, here is the test

   ...
   beforeShowDay: function(d_date){
        console.log(d_date);
        //Here compare your Date Array and the d_date
        var d_picker = new Date(d_date);
        var s_class_highligth = '';
        if($.inArray(d_picker.getDate(),a_date_array)>-1){
            s_class_highligth = 'my_cell_highligth';
        }

        return [true, s_class_highligth, 'this is optional tooltip'];
    }
    ...

Post a Comment for "How To Highlight Specific Dates In The Datepicker"