Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intl.DateTimeFormat returns incorrect values on real iOS devices #1172

Open
jonassvalin opened this issue Oct 23, 2023 · 3 comments
Open

Intl.DateTimeFormat returns incorrect values on real iOS devices #1172

jonassvalin opened this issue Oct 23, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@jonassvalin
Copy link

Bug Description

Greetings 馃憢
We use Luxon in our react-native project for date management. When parsing dates and attempting to output the monthShort or weekdayShort components whilst using a real iOS device, we get null values back.

There is an open issue in Luxon stating that this is an implementation issue in Hermes as it works correctly for other JavaScript engines: moment/luxon#1500

Hermes version: bundled with react-native
React Native version: 0.72.5
Platform: iOS
OS version: 16.6.1

Steps To Reproduce

Direct Hermes example:

moment/luxon#1500 (comment)

Luxon example:

import { DateTime } from 'luxon'
...

  console.log(DateTime.now().month) // -> 10
  console.log(DateTime.now().monthShort) // -> null, but expected Oct or equivalent
@jonassvalin jonassvalin added the bug Something isn't working label Oct 23, 2023
@neildhar
Copy link
Contributor

Thank you for reporting this. Unfortunately, this is a known problem in our implementation of formatToParts on iOS. Hermes currently implements Intl on top of the APIs exposed by the platform, but these APIs are not sufficiently broad on iOS to create a correct implementation of formatToParts.

We have disabled DateTimeFormat.prototype.formatToParts on iOS for now, because of the known correctness problems. Instead, we are working on implementing a version of Intl on top of ICU which will allow us to provide a much broader and more correct Intl implementation at the expense of the added binary size cost of ICU.

@jonassvalin
Copy link
Author

@neildhar Thank you for the update. Is there any rough idea of when the new implementation will be prioritised?

@tmikov
Copy link
Contributor

tmikov commented Dec 8, 2023

FYI, we haven't forgotten this (and other issues). Here is an update on our latest plans: #1211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants