amsul / amsul/pickadate.js

Can't disable times when less than interval

未關閉
#614 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug todo
主要語言
JavaScript
星號
7.6k
分支
981
PR 合併指標
30 天內沒有已合併 PR

描述

Current master (pre-release v3.5.5).

I am no longer able to disable all times with exceptions as described [in the docs](http://amsul.ca/pickadate.js/time.htm#disable-times-inverted). Previously, I was able to do the following to enable only the times between 9:45 and 21:45.

```
rtb_booking_form.timepicker.set( 'disable', [
{
from: [0, 0],
to: [24, 0]
},
{
from: [9, 45],
to: [21, 45],
inverted: true
}
] );
```

After updating the pickadate library, it is showing all dates as available. After some tinkering, I have found it is related to the `interval` setting. If the `interval` is set to 15 minutes, the following will work:

```
rtb_booking_form.timepicker.set( 'disable', [
{
from: [0, 15],
to: [23, 45]
},
{
from: [9, 45],
to: [21, 45],
inverted: true
}
] );
```

However, when the `interval` is raised to `30` all dates become available. It appears to not recognize the first date object because the gap between the times passed, and `0:0` and `24:0`, is smaller than the `interval`.

Using the `true` setting as recommended [in the docs](http://amsul.ca/pickadate.js/time.htm#disable-times-all) does not work, unfortunately. And the end user may adjust the `interval` so I can't just work around this bug very easily.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。