@opengeoweb/form-fields 9.19.0 → 9.19.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/index.esm.js CHANGED
@@ -3037,9 +3037,15 @@ const OpenPicker = () => /*#__PURE__*/React.createElement(CalendarToday, null);
3037
3037
  const getTimezoneOffset = value => value.getTimezoneOffset() * 60000;
3038
3038
  const makeLocalAppearUTC = value => new Date(value.getTime() + getTimezoneOffset(value));
3039
3039
  const localToUTC = dateTime => new Date(dateTime.getTime() - getTimezoneOffset(dateTime));
3040
- const getFormattedValue = value => {
3040
+ /**
3041
+ * Should return an isostring in the form "YYYY-MM-DDThh:mm:ssZ";
3042
+ * The milli seconds section should not be included, strictly YYYY-MM-DDThh:mm:ssZ is important
3043
+ * @param value input Date
3044
+ * @returns iso string in YYYY-MM-DDThh:mm:ssZ format.
3045
+ */
3046
+ const getFormattedValueForDatePicker = value => {
3041
3047
  var _a;
3042
- return (_a = dateUtils.dateToIsoString(value)) !== null && _a !== void 0 ? _a : null;
3048
+ return (_a = dateUtils.dateToString(value, "yyyy-MM-dd'T'HH:mm:ss'Z'", true)) !== null && _a !== void 0 ? _a : null;
3043
3049
  };
3044
3050
  const getDateValue = value => {
3045
3051
  var _a, _b;
@@ -3116,7 +3122,7 @@ const ReactHookKeyboardDateTimePicker = _a => {
3116
3122
  onChangeField(null);
3117
3123
  return;
3118
3124
  }
3119
- const formattedDate = getFormattedValue(localToUTC(value));
3125
+ const formattedDate = getFormattedValueForDatePicker(localToUTC(value));
3120
3126
  onChangeField(formattedDate);
3121
3127
  onChange(formattedDate);
3122
3128
  },
@@ -3244,4 +3250,4 @@ const useDraftFormHelpers = (isDefaultDraft = false) => {
3244
3250
  };
3245
3251
  };
3246
3252
 
3247
- export { HIDDEN_INPUT_HELPER_IS_DRAFT, ReactHookKeyboardDateTimePicker as ReactHookFormDateTime, ReactHookFormFormControl, ReactHookFormHiddenInput, ReactHookFormNumberField, ReactHookFormProviderWrapper as ReactHookFormProvider, ReactHookFormRadioGroup, ReactHookFormSelect, ReactHookFormTextField, defaultFormOptions, errorMessages, getDateValue, getDeepProperty, getFormattedValue, hasIntersectionWithFIR, hasMaxFeaturePoints, hasMulitpleIntersections, isEmpty, isGeometryDirty, isInteger, isLatitude, isLongitude, isMaximumOneDrawing, isNonOrBothCoordinates, isValidGeoJsonCoordinates, isValidMax, isValidMin, isXHoursAfter, isXHoursBefore, useDraftFormHelpers };
3253
+ export { HIDDEN_INPUT_HELPER_IS_DRAFT, ReactHookKeyboardDateTimePicker as ReactHookFormDateTime, ReactHookFormFormControl, ReactHookFormHiddenInput, ReactHookFormNumberField, ReactHookFormProviderWrapper as ReactHookFormProvider, ReactHookFormRadioGroup, ReactHookFormSelect, ReactHookFormTextField, defaultFormOptions, errorMessages, getDateValue, getDeepProperty, getFormattedValueForDatePicker, hasIntersectionWithFIR, hasMaxFeaturePoints, hasMulitpleIntersections, isEmpty, isGeometryDirty, isInteger, isLatitude, isLongitude, isMaximumOneDrawing, isNonOrBothCoordinates, isValidGeoJsonCoordinates, isValidMax, isValidMin, isXHoursAfter, isXHoursBefore, useDraftFormHelpers };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/form-fields",
3
- "version": "9.19.0",
3
+ "version": "9.19.1",
4
4
  "description": "GeoWeb form-fields library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -13,7 +13,7 @@
13
13
  "react-hook-form": "^7.50.1",
14
14
  "@mui/x-date-pickers": "^6.18.5",
15
15
  "lodash": "^4.17.21",
16
- "@opengeoweb/shared": "9.19.0"
16
+ "@opengeoweb/shared": "9.19.1"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": "18"
@@ -2,7 +2,13 @@ import * as React from 'react';
2
2
  import { SxProps, Theme } from '@mui/material';
3
3
  import { DateTimePickerProps, DateTimePickerSlotsComponentsProps } from '@mui/x-date-pickers';
4
4
  import { ReactHookFormInput } from './types';
5
- export declare const getFormattedValue: (value: Date) => string | null;
5
+ /**
6
+ * Should return an isostring in the form "YYYY-MM-DDThh:mm:ssZ";
7
+ * The milli seconds section should not be included, strictly YYYY-MM-DDThh:mm:ssZ is important
8
+ * @param value input Date
9
+ * @returns iso string in YYYY-MM-DDThh:mm:ssZ format.
10
+ */
11
+ export declare const getFormattedValueForDatePicker: (value: Date) => string | null;
6
12
  export declare const getDateValue: (value: string) => Date | null;
7
13
  type ReactHookKeyboardDateTimePickerProps = DateTimePickerProps<Date> & DateTimePickerSlotsComponentsProps<Date> & ReactHookFormInput<{
8
14
  defaultNullValue?: string | null;