Bootstrap datepicker hide after selection

前端 未结 18 2623
暖寄归人
暖寄归人 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条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-13 02:04

    You can change source code, bootstrap-datepicker.js. Add this.hide(); like ne

      if (this.viewMode !== 0) {
        this.date = new Date(this.viewDate);
        this.element.trigger({
            type: 'changeDate',
            date: this.date,
            viewMode: DPGlobal.modes[this.viewMode].clsName
        });
        this.hide();//here
     }
    

提交回复
热议问题