Skip to content

Fix Android DateTimeFormat hour-cycle selection and midnight formatting - #2210

Open
mozzius wants to merge 1 commit into
facebook:mainfrom
mozzius:samuel/fix-android-hour-cycle
Open

mozzius wants to merge 1 commit into
facebook:mainfrom
mozzius:samuel/fix-android-hour-cycle

Conversation

@mozzius

@mozzius mozzius commented Sep 26, 2026

Copy link
Copy Markdown

Summary

Android Hermes reports the requested h11/h24 cycle but formats the midnight hour using h12/h23, and its hour12 choice can disagree with the locale preferred cycle. Use Android ICU to select the locale preferred 12- or 24-hour cycle, preserve the exact resolved hour symbol in the final pattern, and omit day-period fields for 24-hour styled skeletons. The pre-API-24 java.text backend retains its existing selection behavior.

This is the Android counterpart to #2208 and addresses #2209. Standalone React Native / Chromium WebView reproduction: https://github.com/mozzius/hermes-datetimeformat-repro

Test plan

  • On an Android 15 emulator, run the focused Hermes Intl instrumentation regression. It checks h11/h12/h23/h24 at midnight, hour12 locale preference, option precedence, and the presence or absence of dayPeriod parts.
  • In the linked reproducer, compare native Hermes to WebView at local midnight; h11 must display 0 and h24 must display 24.

The focused regression passes on API 35. The entire HermesIntlAndroidTest class currently has unrelated failures in this checkout: three unavailable asset files and two expected regular spaces where Android 15 ICU emits a narrow no-break space.

@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Sep 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant