Skip to content

Commit 4b7f809

Browse files
authored
Release v1.32.2 (#264)
1 parent 563dceb commit 4b7f809

File tree

6 files changed

+16
-22
lines changed

6 files changed

+16
-22
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10+
## [1.32.2] - 2025-02-10
11+
12+
### Fixed
13+
14+
- Fix date field value format
15+
1016
## [1.32.1] - 2025-02-06
1117

1218
### Fixed
@@ -566,7 +572,9 @@ The eye icon is now correctly displayed in the Auth widget.
566572

567573
First version of the SDK Web UI.
568574

569-
[Unreleased]: https://github.com/ReachFive/identity-web-ui-sdk/compare/1.32.1...HEAD
575+
[Unreleased]: https://github.com/ReachFive/identity-web-ui-sdk/compare/1.32.2...HEAD
576+
577+
[1.32.2]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.32.1...v1.32.2
570578

571579
[1.32.1]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.32.0...v1.32.1
572580

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@reachfive/identity-ui",
3-
"version": "1.32.1",
3+
"version": "1.32.2",
44
"description": "ReachFive Identity Web UI SDK",
55
"author": "ReachFive",
66
"repository": {
Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { differenceInYears, formatISO, isValid, parseISO } from "date-fns"
1+
import { differenceInYears } from "date-fns"
22

33
import dateField from './dateField'
44
import { Validator } from '../../../core/validation';
55
import { Config } from '../../../types';
6-
import { isRichFormValue } from "../../../helpers/utils";
76

87
export const ageLimitValidator = (min = 6, max = 129) => new Validator<Date>({
98
rule: (value) => {
@@ -21,19 +20,6 @@ export default function birthdateField(
2120
return dateField({
2221
...props,
2322
label: label,
24-
format: {
25-
bind: (value) => {
26-
const dt = value ? parseISO(value) : undefined
27-
return dt && isValid(dt) ? { raw: dt } : undefined
28-
},
29-
unbind: (value) => {
30-
return isRichFormValue(value, 'raw')
31-
? formatISO(value.raw, { representation: 'date' })
32-
: value
33-
? formatISO(value, { representation: 'date' })
34-
: null
35-
}
36-
},
3723
validator: ageLimitValidator(min, max)
3824
}, config)
3925
}

src/components/form/fields/dateField.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ export default function dateField(
221221
},
222222
unbind: (value) => {
223223
return isRichFormValue(value, 'raw')
224-
? formatISO(value.raw)
224+
? formatISO(value.raw, { representation: 'date' })
225225
: value
226-
? formatISO(value)
226+
? formatISO(value, { representation: 'date' })
227227
: null
228228
}
229229
},

tests/components/form/fields/dateField.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ describe('DOM testing', () => {
174174

175175
expect(onSubmit).toBeCalledWith(
176176
expect.objectContaining({
177-
date: formatISO(new Date(year, month, day)) // value is formatted in handler data
177+
date: formatISO(new Date(year, month, day), { representation: 'date' }) // value is formatted in handler data
178178
})
179179
)
180180

0 commit comments

Comments
 (0)