Disable time in bootstrap date time picker

前端 未结 20 1417
夕颜
夕颜 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:22

    This is for: Eonasdan's Bootstrap Datetimepicker

    First of all I would provide an id attribute for the and then initialize the datetimepicker directly for that (and not for the parent container):

    For v3: Contrary to Ck Maurya's answer:

    • pickDate: false will disable the date and only allow to pick a time
    • pickTime: false will disable the time and only allow to pick a date (which is what you want).

    For v4: Bootstrap Datetimepicker now uses the format to determine if a time-component is present. If no time component is present, it won't let you choose a time (and hide the clock icon).

提交回复
热议问题