-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add date picker string type #205
Conversation
Preview is ready. |
Playwright Test Component is ready. |
const onUpdate = useCallback((date: DateTime | null) => { | ||
if (!date) { | ||
onChange(''); | ||
} else if (spec.viewSpec.dateInput?.outputFormat) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The data output format does not change
Uploading Screen Recording 2024-06-28 at 09.43.43.mov…
src/stories/Editor.stories.tsx
Outdated
dateInput: { | ||
outputFormat: 'YYYY-MM-DD', | ||
}, | ||
inputProps: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's get rid of TC ignore and remove inputProps: {
'maximum', | ||
'minimum', | ||
'format', | ||
'enum', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qa: name, | ||
}; | ||
|
||
return <DatePicker {...props} />; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screen.Recording.2024-06-28.at.09.43.43.mov
input jumps
| Property | Type | Required | Description | | ||
| :----------- | :------- | :------: | :-------------------------------------------------------------------------------------- | | ||
| outputFormat | `string` | | Format returning string. [Available formats](https://day.js.org/docs/en/display/format) | | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also forgot to add a description here that there is such a possibility
https://github.com/gravity-ui/dynamic-forms/blob/add-date-picker/docs/spec.md#stringspec
| Property | Type | Required | Description | | ||
| :----------- | :------- | :------: | :-------------------------------------------------------------------------------------- | | ||
| outputFormat | `string` | | Format returning string. [Available formats](https://day.js.org/docs/en/display/format) | | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are two formats needed here, one format that is waiting for the backend, the second format is the one in which we will display the date to the user
It is worth considering that the backend can wait for a millisecond string or a timestamp object, I did not see it here https://day.js.org/docs/en/display/format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add printFormat
No description provided.