【发布时间】:2021-09-17 12:35:57
【问题描述】:
似乎无论我使用什么包,timeZone RangeError: timeZone is not supported 与 Expo(v40) Android 似乎总是存在问题。我尝试添加 https://github.com/iamkun/dayjs/issues/1377#issuecomment-775991702 中提到的 polyfill,但意识到评论中还提到:
"This code is only usable if you do not use "toLocaleString" anywhere, except dayjs. It just fix dayjs, but can break other code (if it use toLocaleString method)."
我无法编辑应用程序 build.gradle,因为我正在使用 expo,所以对我可以在这里做什么有点困惑。有没有人提出解决方案?
当前设置:
"expo": "~40.0.0",
"expo-localization": "^10.2.0",
"date-fns": "^2.21.3",
"date-fns-tz": "^1.1.4",
"intl": "^1.2.5",
【问题讨论】:
-
pollyfill 看起来是个非常糟糕的主意,因为它取代了内置的 toLocaleString 方法。您需要显示产生错误的代码以及如何指定 timeZone。
标签: javascript android date timezone expo