angular / angular/components

feat(MatDateRangePicker): dateFilter for start and end dates independently.

Open
#26,950 3 comments 1 reaction 0 assignees View on GitHub
area: material/datepicker feature P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

### Feature Description

We have the `dateFilter` input, but this is limited to forcing you to use the same filter for the start range and end range. I'd like to see `startDateFilter` and `endDateFilter` inputs so that I can provide a filter for the start of the range and the end of the range independently. It doesn't have to be this exact solution, so as long as the use-case below can be met.

I think that the `endDateFilter` should also have an argument for the "start date" that the user selected so that you can programmatically define which end date(s) are acceptable for the start date the user selected if that is a necessary constraint.

### Use Case

Our use-case is to require the user to select a date that falls on any Monday then require the user to select any date after Monday so as long as it falls on a Sunday.

I don't see any way to require the user to do this without form validation rules (I'd like this to facilitated by the UI instead of through validation error messages).

The only thing that comes close, is the `SelectionStrategy` functionality, but it doesn't seem suitable for a variable number of weeks.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the MatDateRangePicker dateFilter input and the existing SelectionStrategy functionality. Check how the current API handles start and end dates, then determine whether the use case can support independent Monday start and Sunday end selection while making the selected start date available to end-date filtering. Done means the UI enforces the described constraints without relying on form-validation error messages.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.