@trackunit/react-date-and-time-hooks 1.6.52 → 1.6.53

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/index.cjs.js CHANGED
@@ -101,16 +101,18 @@ const GetAssetTimezoneDocument = {
101
101
  ],
102
102
  };
103
103
 
104
+ const customTimeZoneSchema = zod.z.string().nullable();
104
105
  /**
105
106
  *
106
107
  */
107
108
  const useTimezone = ({ assetId } = {}) => {
108
109
  const { timeZonePreference } = reactCoreHooks.useCurrentUserTimeZonePreference();
109
- const [customTimezone, setCustomTimezone] = reactCoreHooks.useLocalStorage({
110
+ const localStorageProps = react.useMemo(() => ({
110
111
  key: "customTimeZone",
111
112
  defaultState: null,
112
- schema: zod.z.string().nullable(),
113
- });
113
+ schema: customTimeZoneSchema,
114
+ }), []);
115
+ const [customTimezone, setCustomTimezone] = reactCoreHooks.useLocalStorage(localStorageProps);
114
116
  const { data: timeZoneData } = client.useQuery(GetAssetTimezoneDocument, {
115
117
  variables: {
116
118
  assetId: assetId ?? "",
package/index.esm.js CHANGED
@@ -99,16 +99,18 @@ const GetAssetTimezoneDocument = {
99
99
  ],
100
100
  };
101
101
 
102
+ const customTimeZoneSchema = z.string().nullable();
102
103
  /**
103
104
  *
104
105
  */
105
106
  const useTimezone = ({ assetId } = {}) => {
106
107
  const { timeZonePreference } = useCurrentUserTimeZonePreference();
107
- const [customTimezone, setCustomTimezone] = useLocalStorage({
108
+ const localStorageProps = useMemo(() => ({
108
109
  key: "customTimeZone",
109
110
  defaultState: null,
110
- schema: z.string().nullable(),
111
- });
111
+ schema: customTimeZoneSchema,
112
+ }), []);
113
+ const [customTimezone, setCustomTimezone] = useLocalStorage(localStorageProps);
112
114
  const { data: timeZoneData } = useQuery(GetAssetTimezoneDocument, {
113
115
  variables: {
114
116
  assetId: assetId ?? "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-date-and-time-hooks",
3
- "version": "1.6.52",
3
+ "version": "1.6.53",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -13,14 +13,14 @@
13
13
  "@apollo/client": "3.13.8",
14
14
  "react": "19.0.0",
15
15
  "zod": "^3.23.8",
16
- "@trackunit/iris-app-build-utilities": "1.6.48",
17
- "@trackunit/iris-app-api": "1.6.48",
18
- "@trackunit/react-core-contexts-test": "1.6.51",
19
- "@trackunit/date-and-time-utils": "1.6.48",
20
- "@trackunit/shared-utils": "1.8.48",
21
- "@trackunit/react-core-contexts-api": "1.7.49",
22
- "@trackunit/react-core-hooks": "1.6.51",
23
- "@trackunit/react-test-setup": "1.3.48",
16
+ "@trackunit/iris-app-build-utilities": "1.6.49",
17
+ "@trackunit/iris-app-api": "1.6.49",
18
+ "@trackunit/react-core-contexts-test": "1.6.52",
19
+ "@trackunit/date-and-time-utils": "1.6.49",
20
+ "@trackunit/shared-utils": "1.8.49",
21
+ "@trackunit/react-core-contexts-api": "1.7.50",
22
+ "@trackunit/react-core-hooks": "1.6.52",
23
+ "@trackunit/react-test-setup": "1.3.49",
24
24
  "@js-temporal/polyfill": "^0.5.1"
25
25
  },
26
26
  "module": "./index.esm.js",