Highlight certain dates on bootstrap-datepicker

后端 未结 5 600
耶瑟儿~
耶瑟儿~ 2020-12-18 23:06

I\'m using the bootstrap-datepicker to check the days where my website got sales and I want to display or highlight the dates there was at least one sale. I can pass the dat

5条回答
  •  既然无缘
    2020-12-18 23:08

    There is simple way to set multiple dates in bootstrap calendar. There is a property multidate which can be used for the selection. find the working code below.

         $('.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.

提交回复
热议问题