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.

Regression for date of birth formatting for English (United Kingdom)

See original GitHub issue

Avoid duplicates

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:

  1. Tap “Scan” button
  2. Scan 2/2 vaccination certificate
  3. Tap back arrow
  4. Tap “Certificates”
  5. QR code
  6. Scroll down to “Born”
  7. Note that date of birth is wrongly formatted as mm/dd/yyyy

Alternatively on Pixel 3a API 30 (Android 11) emulator

  1. Settings > System > Languages and input > Languages
    set to English (United Kingdom)
  2. Settings > System > Date & time
    disable “Use locale default”/ disable “Use 24-hour format”
  3. Settings > Display > Advanced > Font Size, set Small
  4. In Android Studio Build > Select BuildVariant deviceForTestersDebug
  5. run PersonDetailsFragmentTest.kt on emulator
  6. View > Tools Windows > Device File Explorer
  7. Go to /data/data/de.rki.coronawarnapp.test/screenshots
  8. View screenshots and check the formatting of all dates in PersonDetailsFragment*.png

See here for example PersonDetailsFragment_booster_2.png

PersonDetailsFragment_booster_2-2 11 RC0-EN_GB

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:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
dsarkarcommented, Apr 4, 2022

@MikeMcC399 Thanks for the feedback.

1reaction
dsarkarcommented, Sep 22, 2021

Internal Tracking ID: EXPOSUREAPP-9595

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Write Dates in American and British English
American date format is month-day-year (May 1, 2021); British is day-month-year (1 May 2021). Use commas between day and year in American ...
Read more >
Date and time notation in the United Kingdom - Wikipedia
Date and time notation in the United Kingdom records the date using the day–month–year format (31 December 1999, 31/12/99 or 31/12/1999).
Read more >
24 Working with dates and times - Stata
When you subtract. %tq variables, you obtain the number of quarters between dates. Stata understands nine %t formats: Format. Base. Units. Comment. %tc....
Read more >
How to write dates in British and American English
Whatever the format, in British English, dates are usually written in the order day – month – year, while in American English they...
Read more >
Calculating and displaying regression statistics in Excel
To run the regression, arrange your data in columns as seen below. Click on the “Data” menu, and then choose the. “Data Analysis”...
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