react-timezone-select 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.cjs +7 -3
- package/dist/index.js +7 -3
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -139,8 +139,12 @@ var TimezoneSelect = ({
|
|
|
139
139
|
const tz = now.timezone();
|
|
140
140
|
const tzStrings = (0, import_timezone_soft.default)(zone[0]);
|
|
141
141
|
let label = "";
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
const standardAbbr = tzStrings?.[0]?.standard?.abbr ?? "";
|
|
143
|
+
const dstAbbr = tzStrings?.[0]?.daylight?.abbr ?? standardAbbr;
|
|
144
|
+
let abbr = now.isDST() ? dstAbbr : standardAbbr;
|
|
145
|
+
const standardAltName = tzStrings?.[0]?.standard?.name ?? "";
|
|
146
|
+
const dstAltName = tzStrings?.[0]?.daylight?.name ?? standardAltName;
|
|
147
|
+
let altName = now.isDST() ? dstAltName : standardAltName;
|
|
144
148
|
const min = tz.current.offset * 60;
|
|
145
149
|
const hr = `${min / 60 ^ 0}:` + (min % 60 === 0 ? "00" : Math.abs(min % 60));
|
|
146
150
|
const prefix = `(GMT${hr.includes("-") ? hr : `+${hr}`}) ${zone[1]}`;
|
|
@@ -149,7 +153,7 @@ var TimezoneSelect = ({
|
|
|
149
153
|
label = prefix;
|
|
150
154
|
break;
|
|
151
155
|
case "altName":
|
|
152
|
-
label = `${prefix} ${altName
|
|
156
|
+
label = `${prefix} ${altName ? `(${altName})` : ""}`;
|
|
153
157
|
break;
|
|
154
158
|
case "abbrev":
|
|
155
159
|
label = `${prefix} (${abbr.substring(0, maxAbbrLength)})`;
|
package/dist/index.js
CHANGED
|
@@ -105,8 +105,12 @@ var TimezoneSelect = ({
|
|
|
105
105
|
const tz = now.timezone();
|
|
106
106
|
const tzStrings = soft(zone[0]);
|
|
107
107
|
let label = "";
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
const standardAbbr = tzStrings?.[0]?.standard?.abbr ?? "";
|
|
109
|
+
const dstAbbr = tzStrings?.[0]?.daylight?.abbr ?? standardAbbr;
|
|
110
|
+
let abbr = now.isDST() ? dstAbbr : standardAbbr;
|
|
111
|
+
const standardAltName = tzStrings?.[0]?.standard?.name ?? "";
|
|
112
|
+
const dstAltName = tzStrings?.[0]?.daylight?.name ?? standardAltName;
|
|
113
|
+
let altName = now.isDST() ? dstAltName : standardAltName;
|
|
110
114
|
const min = tz.current.offset * 60;
|
|
111
115
|
const hr = `${min / 60 ^ 0}:` + (min % 60 === 0 ? "00" : Math.abs(min % 60));
|
|
112
116
|
const prefix = `(GMT${hr.includes("-") ? hr : `+${hr}`}) ${zone[1]}`;
|
|
@@ -115,7 +119,7 @@ var TimezoneSelect = ({
|
|
|
115
119
|
label = prefix;
|
|
116
120
|
break;
|
|
117
121
|
case "altName":
|
|
118
|
-
label = `${prefix} ${altName
|
|
122
|
+
label = `${prefix} ${altName ? `(${altName})` : ""}`;
|
|
119
123
|
break;
|
|
120
124
|
case "abbrev":
|
|
121
125
|
label = `${prefix} (${abbr.substring(0, maxAbbrLength)})`;
|
package/package.json
CHANGED