Search code examples
functiondatetimepickerbootstrap-datetimepicker

how to disable bootstrap-dateTimepicker's pick function?


now, I am trying to disable the pick function for some reason, I just want to display the date/time, but it can't be done, it seems that there is no such option or function to reach this? Anyone has an idea why this is the case?


Solution

  • I find that in the latest version of datetimepicker, there is a option "ignoreReadonly", it's default value is false and we don't change it. Just to make add the readonly attribute to the input. Then we can disable the widget. In my old version, there is no such option. so, thanks for your answers and thanks Eonasdan. by the way, the version contains this option, is 4.14+. And you can view the demo by [disabled datetimepicker demo](https://jsfiddle.net/xjkms/hzwpsnjw/2/).