Skip to content

Commit

Permalink
Release v1.32.2 (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
moust authored Feb 10, 2025
1 parent 563dceb commit 4b7f809
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 22 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.32.2] - 2025-02-10

### Fixed

- Fix date field value format

## [1.32.1] - 2025-02-06

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

First version of the SDK Web UI.

[Unreleased]: https://github.com/ReachFive/identity-web-ui-sdk/compare/1.32.1...HEAD
[Unreleased]: https://github.com/ReachFive/identity-web-ui-sdk/compare/1.32.2...HEAD

[1.32.2]: https://github.com/ReachFive/identity-web-ui-sdk/compare/v1.32.1...v1.32.2

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

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@reachfive/identity-ui",
"version": "1.32.1",
"version": "1.32.2",
"description": "ReachFive Identity Web UI SDK",
"author": "ReachFive",
"repository": {
Expand Down
16 changes: 1 addition & 15 deletions src/components/form/fields/birthdayField.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { differenceInYears, formatISO, isValid, parseISO } from "date-fns"
import { differenceInYears } from "date-fns"

import dateField from './dateField'
import { Validator } from '../../../core/validation';
import { Config } from '../../../types';
import { isRichFormValue } from "../../../helpers/utils";

export const ageLimitValidator = (min = 6, max = 129) => new Validator<Date>({
rule: (value) => {
Expand All @@ -21,19 +20,6 @@ export default function birthdateField(
return dateField({
...props,
label: label,
format: {
bind: (value) => {
const dt = value ? parseISO(value) : undefined
return dt && isValid(dt) ? { raw: dt } : undefined
},
unbind: (value) => {
return isRichFormValue(value, 'raw')
? formatISO(value.raw, { representation: 'date' })
: value
? formatISO(value, { representation: 'date' })
: null
}
},
validator: ageLimitValidator(min, max)
}, config)
}
4 changes: 2 additions & 2 deletions src/components/form/fields/dateField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ export default function dateField(
},
unbind: (value) => {
return isRichFormValue(value, 'raw')
? formatISO(value.raw)
? formatISO(value.raw, { representation: 'date' })
: value
? formatISO(value)
? formatISO(value, { representation: 'date' })
: null
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/components/form/fields/dateField.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe('DOM testing', () => {

expect(onSubmit).toBeCalledWith(
expect.objectContaining({
date: formatISO(new Date(year, month, day)) // value is formatted in handler data
date: formatISO(new Date(year, month, day), { representation: 'date' }) // value is formatted in handler data
})
)

Expand Down

0 comments on commit 4b7f809

Please sign in to comment.