how to restrict bootstrap date picker from future date

后端 未结 10 1632
无人共我
无人共我 2020-12-09 08:41

I want to restrict the date picker of bootstrap from taking future date.I just want to enable the dates up to today only.How can i achieve this.

Here is my code

10条回答
  •  醉梦人生
    2020-12-09 09:22

    $(function(){
        $('.datepicker').datepicker({
            format: 'mm-dd-yyyy',
            onRender:function(date){
                return date.valueOf() > FromEndDate.valueOf()?'disabled':'';
            }
         });
    });
    

提交回复
热议问题