Open devhitech opened 8 years ago
I looked quickly over the JS code, and the following small change should do the trick (only works with 1 value in the exclude - for my particular use case it's fine for now - I called the option exHour, exHour: 12
).
Inside _isValidTime: function(i, time) {
having the exHour
option added and the corresponding vars:
if (i.options.exHour !== null) {
ex = normalize(i.options.exHour, null);
}
if (ex !== null) {
if (Date.parse(time) === Date.parse(ex)) {
return false;
}
}
Would be nice to have this feature in the main release though.
The timepicker works great with the min/maxTime/Hour/Minute to set the limits of the shown values.
However there's no option to add a gap/exclusion inside the set interval.
Example of the option (highlighted) I'm looking for:
This would show a dropdown with all the hours between 9 and 18, except 12 and 15.