Age value type shows "This date format is not valid" when database language is changed from English — Capture App

When using a data element with Value Type: Age in the Android Capture app, entering age using the Years/Months/Days fields (e.g. 2 months) triggers the validation error:

“This date format is not valid”

This issue is specific to the Android Capture app and only occurs when the DHIS2 database language is changed from English. The same field works correctly on the Web Capture app and also works on Android when the database language is English.


Steps to Reproduce

  1. Change the DHIS2 database language to a non-English language (e.g. Nepali)
  2. Open the Android Capture app
  3. Navigate to a program/event with an Age value type field
  4. Select Months from the radio buttons (Years / Months / Days)
  5. Enter a numeric value (e.g. 2)
  6. Observe the error: “This date format is not valid”

To confirm:

  • Switch database language back to English → same steps → error disappears :white_check_mark:
  • Reproduce the same steps on Web Capture → works correctly :white_check_mark:

Expected Behavior

The Age field on Android should work correctly regardless of the database language/locale, consistent with the Web Capture app behavior.

Actual Behavior

On Android, when the database language is non-English, the Age field throws “This date format is not valid” and blocks data entry entirely.


Root Cause (suspected)

The Android Capture app appears to use the database locale’s date format when internally constructing the date of birth from the entered Years/Months/Days values. When a non-English locale is active, the constructed date string does not match the expected YYYY-MM-DD format, causing validation to fail. The Web Capture app handles this correctly, suggesting the issue is specific to the Android date parsing logic.

This may be related to the known issue DHIS2-14924.


Environment

  • App: DHIS2 Android Capture App
  • DHIS2 Version: 2.42.4
  • DHIS2 Revision: eaf4b70
  • Capture App Version: v3.4.0
  • Capture SDK: 1.14.0
  • Database Language: Nepali (or your non-English language)

Workarounds (temporary)

  • Revert database language to English
  • Enter date of birth directly instead of using Years/Months/Days fields
  • Use Web Capture app instead of Android

Additional Context

Screenshot attached showing the validation error on Android. This is a blocker for implementations using DHIS2 in local languages (e.g. Nepal, other non-English deployments) that rely on the Android app for field-level data collection.


Happy to provide further details or test on a play instance if needed. Thank you!

1 Like

Dear @sthrohit

Thank you for bringing this bug to our attention.

We have created a JIRA ticket for it.
You can track it here

Regards
Rohit

2 Likes