Ask Your Question
0

How can specific time be disabled using jQuery Timepicker in Laravel-9?

asked 2023-01-28 11:00:00 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-04-18 11:00:00 +0000

david gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-01-28 11:00:00 +0000

Seen: 18 times

Last updated: Apr 18 '22