iamkun / iamkun/dayjs

The timezone plugin is not compatible with React Native Hermes engine

Open
#1,377 57 comments 25 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

The timezone plugin throws a timezone RangeError error when calling .tz because React Native Hermes engine doesn't has support for Intl timezones and toLocaleString

This two lines are the ones that are throwing the error

https://github.com/iamkun/dayjs/blob/dev/src/plugin/timezone/index.js#L20

https://github.com/iamkun/dayjs/blob/dev/src/plugin/timezone/index.js#L98

Could be posible to update the plugin to not depend on Intl and toLocaleString('en-US', { timeZone: timezone }) ?

Contributor guide

Open the contributing guide

Research direction

Start by reading src/plugin/timezone/index.js at lines 20 and 98, then reproduce the .tz failure in a React Native app using the Hermes engine. Confirm the timezone plugin no longer throws a RangeError in that environment, while preserving its existing timezone behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.