date-fns-tz
Advanced tools
Comparing version 1.3.3 to 1.3.4
@@ -127,3 +127,3 @@ "use strict"; | ||
try { | ||
Intl.DateTimeFormat(undefined, { | ||
new Intl.DateTimeFormat(undefined, { | ||
timeZone: timeZoneString | ||
@@ -130,0 +130,0 @@ }); |
@@ -140,3 +140,3 @@ import tzTokenizeDate from '../tzTokenizeDate/index.js' | ||
try { | ||
Intl.DateTimeFormat(undefined, { timeZone: timeZoneString }) | ||
new Intl.DateTimeFormat(undefined, { timeZone: timeZoneString }) | ||
validIANATimezoneCache[timeZoneString] = true | ||
@@ -143,0 +143,0 @@ return true |
{ | ||
"name": "date-fns-tz", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "description": "Time zone support for date-fns v2 with the Intl API", |
@@ -8,3 +8,3 @@ # date-fns-tz | ||
[necessary features](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat#Browser_compatibility), | ||
and for those that don't a [polyfill](https://github.com/yahoo/date-time-format-timezone) can be used. | ||
and for those that don't a [polyfill](https://formatjs.io/docs/polyfills/intl-datetimeformat) can be used. | ||
@@ -49,2 +49,3 @@ If you do not wish to use a polyfill the time zones can still be specified as offsets | ||
any time zone | ||
- [Usage with Android](#usage-with-android) | ||
@@ -284,2 +285,17 @@ ## Overview | ||
## Usage with Android | ||
This library works with React Native, however the `Intl` API is not available by default on Android. | ||
In projects that do not use Hermes, make this change to `android/app/build.gradle`: | ||
```diff | ||
- def jscFlavor = 'org.webkit:android-jsc:+' | ||
+ def jscFlavor = 'org.webkit:android-jsc-intl:+' | ||
``` | ||
React Native does not currently support `Intl` on Android with | ||
Hermes ([facebook/hermes#23](https://github.com/facebook/hermes/issues/23)). The best bet | ||
seems to be using the [polyfills by Format.JS](https://formatjs.io/docs/polyfills/intl-datetimeformat). | ||
## Usage with Node.js | ||
@@ -289,2 +305,3 @@ | ||
i.e. this library will just work. | ||
Node.js v12, which reaches end of life on 30 April 2022, requires running with | ||
@@ -291,0 +308,0 @@ [full ICU data provided at runtime](https://nodejs.org/docs/latest-v12.x/api/intl.html#intl_providing_icu_data_at_runtime). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
211232
317