Skip to content

React Native: formatRange is undefined #1696

@traed

Description

@traed

Describe the bug
When trying to use something like Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); in React Native the app crashes with the message that formatRange is undefined. formatRange is used internally by toLocaleString.

To Reproduce
https://snack.expo.dev/@traed/ts-luxon-bug?platform=ios

Actual vs Expected behavior
I expect toLocaleString to not crash.

Desktop (please complete the following information):

  • OS: iOS or Android
  • Browser: N/A (used in React Native view)
  • Luxon version: 3.6.0
  • Your timezone: "Europe/Stockholm"

Additional context
This works fine in browsers, but not as part of a React Native view.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions