How to highlight specific dates in bootstrap datepicker?

后端 未结 5 1334
广开言路
广开言路 2021-02-20 10:19

I am using bootstrap datepicker.I need to highlight some random dates.

For Example:

I need to highlight the dates like 1,3,8,20,21,16,26,30. Could you please tel

5条回答
  •  清歌不尽
    2021-02-20 11:25

    I found a solution.

         $('.inline_date').datepicker({
            multidate: true,
            todayHighlight: true,
            minDate: 0,
        });
    
     $('.inline_date').datepicker('setDates', [new Date(2015, 7, 5), new Date(2015, 7, 8), new Date(2015, 7, 7)])
    

    Only one problem there the highlights are removed on click. and it take month as one less. if you want August dates then you have to use 7 not 8.

提交回复
热议问题