Regression for date of birth formatting for English (United Kingdom)
See original GitHub issueAvoid 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 Follows on from https://github.com/corona-warn-app/cwa-app-android/issues/4014 (EXPOSUREAPP-9297).
Technical details
- Device name: Google Pixel 3a emulator
- Android version: 11
- First reported in App version: 2.10.1
- Confirmed still present in App version 2.19.2
Describe the bug
If the device locale is set to English (United Kingdom) the date of birth shown in the “Born” field in a certificate displays with format mm/dd/yyyy
which does not follow the locale standard of dd/mm/yyyy
for English (United Kingdom).
(In version CWA 2.9.0 with locale set to English (United Kingdom) the date of birth was displayed as dd.mm.yyyy
, which uses the correct order of day, month and year, although the delimiter “.” is not normally used in UK. The delimiter used in the United Kingdom is commonly “/”.)
Steps to reproduce the issue
Locale set to English (United Kingdom)
On physical device:
- Tap “Scan” button
- Scan 2/2 vaccination certificate
- Tap back arrow
- Tap “Certificates”
- QR code
- Scroll down to “Born”
- Note that date of birth is wrongly formatted as
mm/dd/yyyy
Alternatively on Pixel 3a API 30 (Android 11) emulator
- Settings > System > Languages and input > Languages
set to English (United Kingdom) - Settings > System > Date & time
disable “Use locale default”/ disable “Use 24-hour format” - Settings > Display > Advanced > Font Size, set Small
- In Android Studio Build > Select
BuildVariant deviceForTestersDebug
- run
PersonDetailsFragmentTest.kt
on emulator - View > Tools Windows > Device File Explorer
- Go to
/data/data/de.rki.coronawarnapp.test/screenshots
- View screenshots and check the formatting of all dates in PersonDetailsFragment*.png
See here for example PersonDetailsFragment_booster_2.png
Expected behavior
If the device locale is set to English (United Kingdom) then a date of birth displayed in a numerical form should start with day of the month followed by month then year in that order as in dd/mm/yyyy
.
Possible Fix
Revise formatBirthDate
in Corona-Warn-App/src/main/java/de/rki/coronawarnapp/covidcertificate/person/ui/details/items/CwaUserCard.kt
to take care of device’s chosen locale.
The delimiter “/” cannot be used to infer what order the fields dd
, mm
and yyyy
should be displayed.
Additional information
PR https://github.com/corona-warn-app/cwa-app-android/pull/4036 changed the date of birth formatting in certificates for release/2.10.x.
Internal Tracking ID: EXPOSUREAPP-9595
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
@MikeMcC399 Thanks for the feedback.
Internal Tracking ID: EXPOSUREAPP-9595