material-components / material-components/material-components-android

[MaterialDatePicker] Select new date when a year is changed

Open
#1,723 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request Widget: DatePicker
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

When we change a year in a `DatePicker`, it scrolls to another date, but it is not selected. When we later press "OK", the date doesn't change (strange that even "OK" is enabled). The user has to click a new date and then press "OK". So, he has to make an unneeded click.

I suppose, a new date (the same day and month, except 29 Febuary, and a new year) should be selected. If the user then presses "OK", it should be assigned. If he reconsideres and presses "Cancel", the date won't change.

In pictures below after the user selected 2020 year, a date 19.12.2020 should be selected automatically, and after "OK" it should be assigned to the date field.

![image](https://user-images.githubusercontent.com/10630436/93085246-f6416280-f69d-11ea-985e-38e9b97b3566.png)
![image](https://user-images.githubusercontent.com/10630436/93085298-0eb17d00-f69e-11ea-9cba-a8c85f6facc6.png)
![image](https://user-images.githubusercontent.com/10630436/93085091-b8443e80-f69d-11ea-9a89-665e0b14381b.png)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the MaterialDatePicker year-selection flow and reproduce changing the year, then pressing OK without clicking another date. The fix is complete when the same day and month are selected automatically for the new year, with appropriate handling for February 29, and Cancel still leaves the original date unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.