Skip to content
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

Merged
merged 10 commits into from
Jul 8, 2024
Merged

feat: add date picker string type #205

merged 10 commits into from
Jul 8, 2024

Conversation

wd055
Copy link
Contributor

@wd055 wd055 commented Jun 28, 2024

No description provided.

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@gravity-ui-bot
Copy link
Contributor

Playwright Test Component is ready.

const onUpdate = useCallback((date: DateTime | null) => {
if (!date) {
onChange('');
} else if (spec.viewSpec.dateInput?.outputFormat) {
Copy link
Contributor

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…

dateInput: {
outputFormat: 'YYYY-MM-DD',
},
inputProps: {
Copy link
Contributor

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',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image let's remove the input props

qa: name,
};

return <DatePicker {...props} />;
Copy link
Contributor

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) |

Copy link
Collaborator

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) |

Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add printFormat

@wd055 wd055 merged commit fa6ce32 into main Jul 8, 2024
4 checks passed
@wd055 wd055 deleted the add-date-picker branch July 8, 2024 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants