material-components / material-components/material-components-android
[MaterialDatePicker] Permission to select only an interval when it is not known in advance which start date the user will select
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
Permission to select only the interval, for example no more than 10 days. That is, I do not know which start date the user will choose, after he has selected the start date, then all other dates greater than Start date + interval should be unavailable. And we also need exactly the inverse function, when it is impossible to choose an interval smaller than the specified one. For example, it cannot be less than 5 days, then after selecting the start date, the next 4 days will become unavailable for selection. CalendarConstraints.DateValidator doesn't allow you to create such conditions because I don't know the start date the user will select.
How I see this feature: The programmer creates a DatePicker and sets the duration of the period that can be selected, for example 10 days. The user opens the DatePicker and any date is available for him to select, he selects the first date and the restriction is applied, dates from the selected one and 9 more days remain available for selection. You can add different variations of this function: 1) when the range is exactly 10 days 2) when you can choose a range that is not more than 10 days, but you can choose less. 3) when you can choose more than 10, but not less
Thanks
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading MaterialDatePicker and CalendarConstraints.DateValidator to understand how date availability is currently determined. Define the expected behavior for exact, maximum, and minimum intervals, including the post-start-date restriction, and establish how completion should be verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100