To disable time in Bootstrap date time picker with JavaScript, we call the datetimepicker
method with an object with the format
property.
For instance, we write
<input data-format="yyyy-MM-dd" type="text" id="datetimepicker4" />
to add a date time picker input.
Then we write
$("#datetimepicker4").datetimepicker({
format: "YYYY-MM-DD",
});
to select the input with $
and call datetimepicker
with an object that sets the format
to "YYYY-MM-DD"
.
The the time picker will be disabled in the date time picker.