jQuery ui datepicker conflict with bootstrap datepicker

前端 未结 8 2226
梦如初夏
梦如初夏 2020-12-01 18:26

I want to show two months using bootstrap datepicker. After search on google I am not able to find how to show multiple months using bootstrap datepicker. I found that I can

8条回答
  •  一向
    一向 (楼主)
    2020-12-01 19:11

    Bootstrap Datepicker conflict with jquery UI datepicker. f you want to use Bootstrap datepicker then try this

    var datepicker = $.fn.datepicker.noConflict(); // return $.fn.datepicker to previously assigned value
    $.fn.bootstrapDP = datepicker;                 // give $().bootstrapDP the bootstrap-datepicker functionality
    
    // Call bootstrap datepicker function
    $('#datepickermodel').bootstrapDP({
          format: 'dd/mm/yyyy',
          todayHighlight: true
    });
    

    This works for me. I hope this will work for you as well :)

    For more details: https://bootstrap-datepicker.readthedocs.io/en/master/#no-conflict-mode

提交回复
热议问题