Sometimes, we want to disable time in Bootstrap date time picker with JavaScript.
In this article, we’ll look at how to disable time in Bootstrap date time picker with JavaScript.
How to disable time in Bootstrap date time picker with JavaScript?
To disable time in Bootstrap date time picker with JavaScript, we call datetimepicker
with an object with the format
property.
For instance, we write
$("#datetimepicker4").datetimepicker({
format: "YYYY-MM-DD",
});
to call datetimepicker
with an object with format
set to 'YYYY-MM-DD'
to disable the time picker.
Conclusion
To disable time in Bootstrap date time picker with JavaScript, we call datetimepicker
with an object with the format
property.