Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To disable a specific time in jQuery Timepicker, you can set the disableTimeRanges option to an array of time ranges that you want to disable. Here's an example code snippet in Laravel-9:

$('#timepicker').datetimepicker({
  datepicker: false,
  format: 'H:i',
  allowTimes: ['08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00'],
  disableTimeRanges: [['11:00', '12:00']] // Disable time range from 11am to 12pm
});

In this example, we set the allowTimes option to an array of valid times that can be selected. We then set the disableTimeRanges option to an array containing a single time range that we want to disable, from 11am to 12pm.

You can customize this code snippet to suit your specific needs, including setting different time ranges to disable or enabling other options.