Skip to content

Intl.DateTimeFormat().resolvedOptions().calendar is undefined #1716

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AlteredConstants opened this issue May 29, 2025 · 4 comments
Open
Labels
bug Something isn't working

Comments

@AlteredConstants
Copy link

Bug Description

Intl.DateTimeFormat().resolvedOptions().calendar is not defined on iOS.

I suspect this is a new change as of about a week ago and is possibly related to an iOS update?

My Expo app (SDK 52.0.44) suddenly started crashing on start up about a week ago because this property wasn't defined. In my case, the crash was related to the Temporal polyfill which is expecting the calendar property to exist. I had recently updated from version 0.44 to 0.51 of the polyfill, however there was no issue for about a month after the update until about a week ago when the polyfill started throwing an error due to calendar not being defined. The code in the polyfill also doesn't suggest that it's using this value any differently between the versions.

React Native version: 0.76.9
OS: iOS
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): tested on an iPhone 16 Pro Max, whatever that uses

Steps To Reproduce

Here is an Expo Snack that reproduces the issue:

https://snack.expo.dev/@miramar-zeff/ios-missing-intl-datetimeformat-calendar-bug?platform=ios

Launch the iOS instance and note how the "Calendar:" is blank. It shows "Calendar: gregory" (with my locale, at least) in Android and Web.

The Expected Behavior

Based on the MDN article, I believe this value should always be defined, though I guess I'm not certain. It appears in web and Android builds, at least.

@AlteredConstants AlteredConstants added the bug Something isn't working label May 29, 2025
@tmikov tmikov added need-repro Potentially valid, but blocked on missing test case to reproduce and removed bug Something isn't working labels May 29, 2025
@tmikov
Copy link
Contributor

tmikov commented May 29, 2025

Hi, unfortunately we are unable to investigate problems in external polyfills, etc, and in older versions of RN. In order to help, we need a minimal reproduction using the latest Hermes CLI.

@AlteredConstants
Copy link
Author

AlteredConstants commented May 29, 2025

Hi, I don't think the polyfill is the problem. I only mentioned it for context for how that calendar value is being used in my case.

As for the React Native version, you can configure the Expo Snack I provided to use Expo 53 which I believe should be using RN 0.79.

I don't currently have access to an iOS device to test with nor know how to use the Hermes CLI to run on iOS, but if all you need is a code example, then executing this on an iOS device/simulator should be sufficient:

console.log(Intl.DateTimeFormat().resolvedOptions().calendar);

I expect this to log some calendar value (such as "gregory") but for me, as demonstrated in the Snack, it logs undefined.

@tmikov
Copy link
Contributor

tmikov commented May 30, 2025

Thanks, I confirmed that Intl.DateTimeFormat().resolvedOptions().calendar is indeed missing on MacOS.

@tmikov tmikov added bug Something isn't working and removed need-repro Potentially valid, but blocked on missing test case to reproduce labels May 30, 2025
@AlteredConstants
Copy link
Author

Great! Sorry for the confusion. Let me know if you need me to update my original post to help clarify anything for future reference.

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

2 participants