Bootstrap datepicker hide after selection

前端 未结 18 2627
暖寄归人
暖寄归人 2020-12-13 01:30

How do I hide the calendar after a date is selected? Is there a specific function that I can use? My code below:

$(\'#dp1\').datepicker({
    format: \'mm-d         


        
18条回答
  •  -上瘾入骨i
    2020-12-13 01:44

    If you're looking to override the behavior of the calendar in general, globally, try editing the Datepicker function (in my example it was line 82),

    from

        this.autoclose = false;
    

    to

        this.autoclose = true;
    

    Worked fine for me, as I wanted to have all my calendar instances behave the same.

提交回复
热议问题