@hortiview/shared-components 2.22.0 → 2.23.0
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/CHANGELOG.md +11 -0
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.d.ts +14 -2
- package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +5233 -5223
- package/dist/components/FormComponents/FormDatePicker/FormDatePickerService.d.ts +40 -0
- package/dist/components/FormComponents/FormDatePicker/FormDatePickerService.js +9 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## [2.23.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.22.0...v2.23.0) (2026-04-13)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* improve FormDatePicker UTC handling and date conversion logic ([d2e6000](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/d2e6000f5e6e60acdd4c424297b76ea5d1d2f88a))
|
|
6
|
+
|
|
7
|
+
### Code Refactoring
|
|
8
|
+
|
|
9
|
+
* extract FormDatePicker utility functions into a separate service file; linting ([7908c2c](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/7908c2c5233c841965a515f7144656fdd0d12285))
|
|
10
|
+
* rename and update date handling functions for improved clarity and functionality ([1f6713b](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/commit/1f6713bbe19e84f01f57890f7c77559ce281e9d5))
|
|
11
|
+
|
|
1
12
|
## [2.22.0](https://dev.azure.com/sdundc/HV%20Platform/_git/HortiView-Frontend-Shared/compare/v2.21.0...v2.22.0) (2026-04-13)
|
|
2
13
|
|
|
3
14
|
### Features
|
|
@@ -21,7 +21,7 @@ type DatePickerProps<T extends FieldValues> = {
|
|
|
21
21
|
helperText?: string;
|
|
22
22
|
/** Add the number of years to subtract from the current date as bottom of range */
|
|
23
23
|
minRangeYear?: number;
|
|
24
|
-
/** Add the number of years to add to the current date as top of range */
|
|
24
|
+
/** Add the number of years to add to the current date as top of the range */
|
|
25
25
|
maxRangeYear?: number;
|
|
26
26
|
/** Locale to be used for the date picker. */
|
|
27
27
|
locale?: string;
|
|
@@ -30,6 +30,18 @@ type DatePickerProps<T extends FieldValues> = {
|
|
|
30
30
|
* FormDatePicker is a custom form input component for selecting dates.
|
|
31
31
|
* It is integrated with react-hook-form for form management.
|
|
32
32
|
*
|
|
33
|
+
* Date handling model used by this component:
|
|
34
|
+
*
|
|
35
|
+
* - The persisted/form value is a "date-only" value stored as a Date at 00:00:00 UTC.
|
|
36
|
+
* - The UI date picker works with Date objects in the browser's local timezone.
|
|
37
|
+
* - Before rendering, the stored UTC date is converted into a local Date with the same
|
|
38
|
+
* calendar year/month/day so the picker shows the expected day for the user.
|
|
39
|
+
* - After selection, the picked local calendar date is converted back into a UTC-midnight Date
|
|
40
|
+
* before storing it in react-hook-form.
|
|
41
|
+
*
|
|
42
|
+
* This conversion is necessary to avoid timezone-related off-by-one-day issues when working
|
|
43
|
+
* with date-only values.
|
|
44
|
+
*
|
|
33
45
|
* @param propertyName - the name of the property this date picker maps to in the form.
|
|
34
46
|
* @param label - label displayed along with the date picker.
|
|
35
47
|
* @param closeLabel - label displayed as close button text.
|
|
@@ -43,5 +55,5 @@ type DatePickerProps<T extends FieldValues> = {
|
|
|
43
55
|
*
|
|
44
56
|
* @returns A JSX element that renders a date picker form input.
|
|
45
57
|
*/
|
|
46
|
-
export declare const FormDatePicker: <T extends FieldValues>({ propertyName, label, closeLabel, className, minRangeYear, maxRangeYear, locale, rules, helperText, ...props }: Omit<ElementDatePickerProps, "locale"> & DatePickerProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
export declare const FormDatePicker: <T extends FieldValues>({ propertyName, label, closeLabel, className, minRangeYear, maxRangeYear, locale, rules, helperText, ...props }: Omit<ElementDatePickerProps, "locale" | "useUtc"> & DatePickerProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
47
59
|
export {};
|