@trackunit/custom-field-components 1.17.15 → 1.17.17

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
@@ -170,7 +170,8 @@ const DateCustomField = (props) => {
170
170
  const { setValue, defaultValue, register, id, validationRules, ...rest } = props;
171
171
  const onChangeHandler = react.useCallback((e) => {
172
172
  if (setValue) {
173
- setValue(id, e.target.valueAsDate?.toISOString(), {
173
+ const isoUTC = reactFormComponents.toISODateStringUTC(e.target.value);
174
+ setValue(id, isoUTC ?? undefined, {
174
175
  shouldDirty: true,
175
176
  shouldValidate: true,
176
177
  });
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { registerTranslations, useNamespaceTranslation } from '@trackunit/i18n-library-translation';
3
3
  import { getCustomFieldValueForDisplayInUI } from '@trackunit/iris-app-runtime-core';
4
- import { FormGroup, Checkbox, DateField, MultiSelectField, SelectField, TextBaseInput, useGetPhoneValidationRules, NumberField, TextField, PhoneField, ActionButton } from '@trackunit/react-form-components';
4
+ import { FormGroup, Checkbox, toISODateStringUTC, DateField, MultiSelectField, SelectField, TextBaseInput, useGetPhoneValidationRules, NumberField, TextField, PhoneField, ActionButton } from '@trackunit/react-form-components';
5
5
  import { uuidv4, exhaustiveCheck } from '@trackunit/shared-utils';
6
6
  import { useState, useEffect, useCallback, createElement, useMemo } from 'react';
7
7
  import { Controller, useWatch } from 'react-hook-form';
@@ -168,7 +168,8 @@ const DateCustomField = (props) => {
168
168
  const { setValue, defaultValue, register, id, validationRules, ...rest } = props;
169
169
  const onChangeHandler = useCallback((e) => {
170
170
  if (setValue) {
171
- setValue(id, e.target.valueAsDate?.toISOString(), {
171
+ const isoUTC = toISODateStringUTC(e.target.value);
172
+ setValue(id, isoUTC ?? undefined, {
172
173
  shouldDirty: true,
173
174
  shouldValidate: true,
174
175
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/custom-field-components",
3
- "version": "1.17.15",
3
+ "version": "1.17.17",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -8,15 +8,15 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "react-select": "^5.10.2",
11
- "@trackunit/react-form-components": "1.18.15",
12
- "@trackunit/shared-utils": "1.13.84",
13
- "@trackunit/custom-field-api": "1.17.15",
14
- "@trackunit/iris-app-runtime-core": "1.14.10",
15
- "@trackunit/react-components": "1.20.13",
16
- "@trackunit/react-modal": "1.18.15",
17
- "@trackunit/react-core-hooks": "1.14.12",
18
- "@trackunit/i18n-library-translation": "1.15.14",
19
- "@trackunit/iris-app-runtime-core-api": "1.13.10"
11
+ "@trackunit/react-form-components": "1.18.17",
12
+ "@trackunit/shared-utils": "1.13.85",
13
+ "@trackunit/custom-field-api": "1.17.16",
14
+ "@trackunit/iris-app-runtime-core": "1.14.11",
15
+ "@trackunit/react-components": "1.20.14",
16
+ "@trackunit/react-modal": "1.18.17",
17
+ "@trackunit/react-core-hooks": "1.14.13",
18
+ "@trackunit/i18n-library-translation": "1.15.15",
19
+ "@trackunit/iris-app-runtime-core-api": "1.13.11"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "react": "^19.0.0",