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

RangePicker with componentProps valueFormat ('YYYY-MM-DD') does not return the formatted value when using form validate() method #3690

Closed
3 tasks done
doraemonxxx opened this issue Mar 26, 2024 · 1 comment

Comments

@doraemonxxx
Copy link

doraemonxxx commented Mar 26, 2024

⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.

  • Read the docs.
  • Make sure the code is up to date. (Some bugs have been fixed in the latest code)
  • This is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.

Describe the bug

When utilizing a RangePicker component with componentProps set to valueFormat ('YYYY-MM-DD'), the formatted value isn't returned as expected when the validate() method of a form is employed.

Reproduction

export const testSchema: FormSchema[] = [ { label: 'Date', field: 'created_at', required: true, component: 'RangePicker', componentProps: { valueFormat: 'YYYY-MM-DD', }, }, ];

const handleSet = () => { setFieldsValue({ created_at: [dateRangeMonth.fromDate, dateRangeMonth.toDate], }); };

const handleSubmit = async () => { const v = await validate(); console.log('handleSubmit vvvvv', v); };

Current result
[ "2024-02-26 00:00:00", "2024-03-26 00:00:00" ]

Actual result should be: [ "2024-02-26", "2024-03-26" ]

System Info

  • Operating System: Windows 11
  • Node version: v20.11.0
  • Package manager (npm/yarn/pnpm) and version: pnpm 8.14.1
@doraemonxxx
Copy link
Author

doraemonxxx commented Mar 26, 2024

Reference to the bug: arr.push(ele ? dateUtil(ele) : null);

pr: #3691

jinmao88 pushed a commit that referenced this issue Apr 11, 2024
* fix: bug RangePicker with componentProps valueFormat ('YYYY-MM-DD') does not return the formatted value when using form validate() method #3690

* fix: breadcrumb is displayed despite the menu being hidden
@github-actions github-actions bot locked and limited conversation to collaborators Aug 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant