question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Date of birth input should use input view not calendar view

See original GitHub issue

Avoid duplicates

  • Bug is not mentioned in the FAQ
  • Bug is specific for Android only, for general issues / questions that apply to iOS and Android please raise them in the documentation repository
  • Bug is not already reported in another issue

Technical details

  • Device name: Google Pixel 3a emulator
  • Android version: 11
  • App version: 2.7.1 2.9.0

Describe the bug

The date picker for date of birth in the Rapid Test Profile and in COVID Test Certificate opens by default in calendar view. The recommended view for dates not near to the current date, like dates of birth, is input view.

The title of the date picker is not set. The default “SELECT DATE” is shown.

Steps to reproduce the issue

  1. Set locale to English (United Kingdom)
  2. Tap “Manage Your Tests”
  3. Tap “Create Rapid Test Profile” (tap “CONTINUE” if prompted)
  4. Tap “Date of Birth”
  5. Note that the date picker appears in calendar view, with title “SELECT DATE” and today’s date selected
  6. Tap “CANCEL”, tap back arrow
  7. Tap “Scan QR Code”, tap “ACCEPT”
  8. Scan QR Code e.g. PCR Test QR Code
  9. Tap “Date of Birth”
  10. Note that the date picker appears in calendar view, with title “SELECT DATE”

calendar view

Expected behavior

Follow the advice from https://material.io/components/date-pickers#mobile-pickers and use the mobile date input picker, not the calendar view.

Add the title “Date of Birth” to the data picker, so the user is reminded what data they are being asked to enter.

Possible Fix

After https://github.com/corona-warn-app/cwa-app-android/blob/97fbc95b71db96ed637af3eaa35118eb705a1611/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/coronatest/rat/profile/create/RATProfileCreateFragment.kt#L130-L132

add

.setInputMode(MaterialDatePicker.INPUT_MODE_TEXT)
.setTitleText(getResources().getString(R.string.rat_profile_create_birth_date_hint))

After https://github.com/corona-warn-app/cwa-app-android/blob/97fbc95b71db96ed637af3eaa35118eb705a1611/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/submission/covidcertificate/RequestCovidCertificateFragment.kt#L133-L135

add

.setInputMode(MaterialDatePicker.INPUT_MODE_TEXT)
.setTitleText(getResources().getString(R.string.request_green_certificate_birthdate_hint))

input view

Workaround

Select input view from calendar view by tapping the pencil icon.

image

Additional context

https://material.io/components/date-pickers#mobile-pickers says

Don’t

Don’t use a calendar picker to prompt for dates in the distant past or future, such as a date of birth. In these cases, use a mobile input picker or a text field instead.

Do

For dates that don’t require a calendar view, make the mobile date input picker as the default prompt.


Internal Tracking ID: EXPOSUREAPP-9128

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
MikeMcC399commented, Aug 27, 2021

@dsarkar

FYI, UX team has assessed this issue and agrees in principle with your suggestion.

Thank you and the UX team for considering! Stand by for a PR from me once the work on PR https://github.com/corona-warn-app/cwa-app-android/pull/3987 has stabilized.

2reactions
MikeMcC399commented, Aug 23, 2021

@dsarkar Yes, I did already try it out and I can provide a PR if dev would like this submission.

It is an enhancement, not a bug correction. It is just more inconvenient to enter a date of birth from the calendar view.

Let me know if the PR is wanted. If they say no, then that is OK with me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

new UIDatePicker as inputView | Apple Developer Forums
We are aware of this issue. As a workaround for now you can call sizeToFit on the date picker before assigning it as...
Read more >
<input type="date"> - HTML: HyperText Markup Language
Date inputs provide an easy interface for choosing dates, and they normalize the data format sent to the server regardless of the user's...
Read more >
How to show calendar popup when input[type="date"] is on ...
Currently I can only utilize the calendar on click of an arrow at the far right side of the input element. Large Input...
Read more >
Is input type="date" ready for use in accessible websites?
Opening the calendar view on date inputs where min and/or max values are set shows how valid dates and today's date are differentiated....
Read more >
Bad Practices on Birthdate Form Fields - UX Movement
When they see a required format that's different than what they're used to they have to think hard about their input. birthdate_field-format.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found