tempusdominus / bootstrap-4

Tempus Dominus Bootstrap 4 Datetime Picker
https://getdatepicker.com/5-4/
MIT License
611 stars 239 forks source link

disabledTimeIntervals it only considers array[0] and array[1] #366

Open ictnw opened 3 years ago

ictnw commented 3 years ago

tempusdominus-bootstrap-4 row-> 634

$.each(this._options.disabledTimeIntervals, function () {
        if (targetMoment.isBetween(this[0], this[1])) {
           found = true;
          return false;
}

to:

 $.each(this._options.disabledTimeIntervals, function (index) {
    if (index % 2) return true
    if (targetMoment.isBetween (this [index], this [index+1])) {
       found = true;
       return false;
    }

unfortunately it doesn't seem to work well