react-timezone-select
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -108,4 +108,8 @@ // src/index.tsx | ||
let label = ""; | ||
let abbr = now.isDST() ? tzStrings[0].daylight.abbr : tzStrings[0].standard.abbr; | ||
let altName = now.isDST() ? tzStrings[0].daylight.name : tzStrings[0].standard.name; | ||
const standardAbbr = tzStrings?.[0]?.standard?.abbr ?? ""; | ||
const dstAbbr = tzStrings?.[0]?.daylight?.abbr ?? standardAbbr; | ||
let abbr = now.isDST() ? dstAbbr : standardAbbr; | ||
const standardAltName = tzStrings?.[0]?.standard?.name ?? ""; | ||
const dstAltName = tzStrings?.[0]?.daylight?.name ?? standardAltName; | ||
let altName = now.isDST() ? dstAltName : standardAltName; | ||
const min = tz.current.offset * 60; | ||
@@ -119,3 +123,3 @@ const hr = `${min / 60 ^ 0}:` + (min % 60 === 0 ? "00" : Math.abs(min % 60)); | ||
case "altName": | ||
label = `${prefix} ${altName?.length ? `(${altName})` : ""}`; | ||
label = `${prefix} ${altName ? `(${altName})` : ""}`; | ||
break; | ||
@@ -122,0 +126,0 @@ case "abbrev": |
{ | ||
"name": "react-timezone-select", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Usable, dynamic React Timezone Select", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -26,3 +26,3 @@ # 🌐⌚ react-timezone-select | ||
```bash | ||
npm install react-timezone-select | ||
npm install react-select react-timezone-select | ||
``` | ||
@@ -29,0 +29,0 @@ |
Sorry, the diff of this file is not supported yet
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
26606
456