How to restrict the selectable date ranges in Bootstrap Datepicker?

前端 未结 6 958
孤城傲影
孤城傲影 2020-11-27 02:42

I need to use datepicker which provides me the option of restricting the selectable dates. We had been using jQuery UI which is used to support it using minDate, maxDate opt

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 03:15

    The Bootstrap datepicker is able to set date-range. But it is not available in the initial release/Master Branch. Check the branch as 'range' there (or just see at https://github.com/eternicode/bootstrap-datepicker), you can do it simply with startDate and endDate.

    Example:

    $('#datepicker').datepicker({
        startDate: '-2m',
        endDate: '+2d'
    });
    

提交回复
热议问题