feat(MatDatePicker): DateRange should implement min/max duration
- 主要言語
- TypeScript
- スター
- 25k
- フォーク
- 6.8k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 91
説明
#### Feature Description
I would like to use date picker to allow a user to pick any number of days from 1-7, but no more than 7.
This could be implemented by adding a minimum (default: 1) and maximum (default: unlimited) duration values to the DateRange type.
If the minimum duration is not default:
- create greyed-out preview overlay of end values less than the minimum duration but not before the start value. Selecting a value within the minimum duration or before the start date should reset the start date to new date.
If the maximum duration is not default:
- create a preview up to the maximum duration. Selecting value beyond the maximum duration becomes new start date.
Example with (min 3 days, max 7 days) might look like something this:

(this is only to illustrate, I'm not a UI designer or anything)
#### Use Case
Currently, I must have the user use a dropdown to pick their duration first (which informs a MatDateRangeSelectionStrategy), and then use the date picker to select a start date.

Would very much like to get rid of the dropdown.
コントリビューションガイド
調査の方向性
まず、issue で説明されている MatDatePicker の日付範囲の動作と MatDateRangeSelectionStrategy を読みます。プレビューオーバーレイや、選択範囲が許可された範囲外になったときに開始日をリセットする動作を含め、最小期間と最大期間の動作を定義して検証します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular, typescript
- 領域
- frontend
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100