Disable time in bootstrap date time picker

前端 未结 20 1396
夕颜
夕颜 2021-01-30 07:56

I am using bootstrap date time picker in my web application, made in PHP/HTML5 and JavaScript. I am currently using one from here: http://tarruda.github.io/bootstrap-datetimepic

20条回答
  •  隐瞒了意图╮
    2021-01-30 08:36

    Initialize your datetimepicker like this

    For disable time

    $(document).ready(function(){
        $('#dp3').datetimepicker({
          pickTime: false
        });
    });
    

    For disable date

    $(document).ready(function(){
        $('#dp3').datetimepicker({
          pickDate: false
        });
    });
    

    To disable both date and time

    $(document).ready(function(){
       $("#dp3").datetimepicker('disable'); 
    });
    

    please refer following documentation if you have any doubt

    http://eonasdan.github.io/bootstrap-datetimepicker/#options

提交回复
热议问题