amsul / amsul/pickadate.js

Can't disable times when less than interval

オープン
#614 コメント 3 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。