adopted-ember-addons / adopted-ember-addons/ember-pikaday

Setting minDate and maxDate after date is selected clears selection

オープン
#530 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
156
フォーク
164
PR マージ指標
30日以内にマージされた PR はありません

説明

I have two date pickers that work together, the end date and the start date.

I want to set the minDate of the end date to the selection of the start date (because it cannot end before it starts) and vice versa.

This is how I am doing it:

```
onInputDateTo(date) {
...
const dateEndOfDay = new Date(date)
dateEndOfDay.setHours(23, 59, 59, 999)
this.maxDateFromAllowed = dateEndOfDay;
...
```

Notice how I use setHours to change to the end of the day to allow the selection of the same day.

No matter which day is selected, setting the `maxDateFromAllowed` will clear the selection of the start date.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

No file or test is named in the issue. Start by reproducing the two-picker flow described, including setting maxDate or minDate after selecting a date and allowing the same day on both pickers. Done means updating either bound no longer clears the existing selection while the stated date constraints remain enforced.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。