jQuery ui datepicker conflict with bootstrap datepicker

前端 未结 8 2217
梦如初夏
梦如初夏 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 18:52

    You can use bootstrap and jQuery-UI together with almost no issue if using the datepicker.

    At least I had no issue, but I had jQuery-UI working and then applied bootstrap. I recommend that approach.

    Here is the jQuery-UI Implementation of datepicker with multiple months.

          $(function() {
              $( "#datepicker" ).datepicker({
              numberOfMonths: 3,
              showButtonPanel: true
              });
           });
    

    Now here's my implementation of jQueryUI:

    HTML Element:

                
    

    JS:

        $(function() {
            $(".datepicker").datepicker({
                dateFormat: 'yy-mm-dd',
                numberOfMonths:2
            });
        });
    

    As you can see I use class instead of ID because on some pages I use multiple date selectors.

提交回复
热议问题