Intl.DateTimeFormat returns incorrect values on real iOS devices
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.3k
- Forks
- 865
- Avg merge
- 1h 30m
- Merged PRs (30d)
- 3
Description
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: https://github.com/moment/luxon/issues/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:
https://github.com/moment/luxon/issues/1500#issuecomment-1709612387
Luxon example:
import { DateTime } from 'luxon'
...
console.log(DateTime.now().month) // -> 10
console.log(DateTime.now().monthShort) // -> null, but expected Oct or equivalent
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the direct Hermes reproduction from the linked Luxon issue on a real iOS device, then compare the Intl.DateTimeFormat behavior with other JavaScript engines. Locate the relevant Hermes Intl implementation and tests; done means monthShort and weekdayShort return the expected values in the Luxon example rather than null.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, javascript, react-native
- Domain
- internationalization, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100