react-timezone-select 3.2.0 → 3.2.2
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/dist/index.js +5 -10
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -119,6 +119,7 @@ var timezone_list_default = allTimezones;
|
|
|
119
119
|
|
|
120
120
|
// src/index.tsx
|
|
121
121
|
import { jsx } from "react/jsx-runtime";
|
|
122
|
+
"use client";
|
|
122
123
|
function useTimezoneSelect({
|
|
123
124
|
timezones = timezone_list_default,
|
|
124
125
|
labelStyle = "original",
|
|
@@ -174,22 +175,16 @@ function useTimezoneSelect({
|
|
|
174
175
|
} catch (err) {
|
|
175
176
|
currentTime = (currentDatetime ? spacetime(currentDatetime) : spacetime.now()).goto("GMT");
|
|
176
177
|
}
|
|
177
|
-
return options.filter(
|
|
178
|
-
(tz) => tz.offset === currentTime.timezone().current.offset
|
|
179
|
-
).map((tz) => {
|
|
178
|
+
return options.filter((tz) => tz.offset === currentTime.timezone().current.offset).map((tz) => {
|
|
180
179
|
let score = 0;
|
|
181
180
|
if (currentTime.timezones[tz.value.toLowerCase()] && !!currentTime.timezones[tz.value.toLowerCase()].dst === currentTime.timezone().hasDst) {
|
|
182
|
-
if (tz.value.toLowerCase().indexOf(
|
|
183
|
-
currentTime.tz.substring(currentTime.tz.indexOf("/") + 1)
|
|
184
|
-
) !== -1) {
|
|
181
|
+
if (tz.value.toLowerCase().indexOf(currentTime.tz.substring(currentTime.tz.indexOf("/") + 1)) !== -1) {
|
|
185
182
|
score += 8;
|
|
186
183
|
}
|
|
187
|
-
if (tz.label.toLowerCase().indexOf(
|
|
188
|
-
currentTime.tz.substring(currentTime.tz.indexOf("/") + 1)
|
|
189
|
-
) !== -1) {
|
|
184
|
+
if (tz.label.toLowerCase().indexOf(currentTime.tz.substring(currentTime.tz.indexOf("/") + 1)) !== -1) {
|
|
190
185
|
score += 4;
|
|
191
186
|
}
|
|
192
|
-
if (tz.value.toLowerCase().indexOf(currentTime.tz.substring(0, currentTime.tz.indexOf("/")))) {
|
|
187
|
+
if (tz.value.toLowerCase().indexOf(currentTime.tz.substring(0, currentTime.tz.indexOf("/"))) !== -1) {
|
|
193
188
|
score += 2;
|
|
194
189
|
}
|
|
195
190
|
score += 1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-timezone-select",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "Usable, dynamic React Timezone Select",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "concurrently \"tsup src/index.tsx --format esm --watch\" \"cd example && pnpm dev\"",
|
|
@@ -101,8 +101,7 @@
|
|
|
101
101
|
},
|
|
102
102
|
"prettier": {
|
|
103
103
|
"semi": false,
|
|
104
|
-
"
|
|
105
|
-
"maxLineLength": 100
|
|
104
|
+
"printWidth": 100
|
|
106
105
|
},
|
|
107
106
|
"simple-git-hooks": {
|
|
108
107
|
"pre-commit": "npx lint-staged"
|