ant-design / ant-design/pro-components

🐛[BUG]Schema Form格式的表单,在formList里的date组件,设置了format未生效

Open
#9,663 1 comment 0 reactions 0 assignees View on GitHub
form
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

### 🐛 bug 描述

Schema Form格式的表单,在formList里的date日期组件,设置了format为YYYY-MM-DD,提交表单时,格式化未生效

### 🏞 期望结果

正确格式化

### 💻 复现代码

```
{
title: '产品信息',
valueType: 'formList',
dataIndex: 'detailList',
initialValue: [
{
name: '',
deliveryDate: null,
deliveryLocation: '',
},
],
fieldProps: {
alwaysShowItemLabel: true,
},
formItemProps: {
rules: [
{
required: true,
message: '此项为必选项',
},
],
className: 'horizontal-form-list contract-form-list',
},
colProps: {
span: 24,
},
columns: [
{
title: '产品种类',
dataIndex: 'name',
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
colProps: {
span: 7,
},
},
{
title: '交货日期',
dataIndex: 'deliveryDate',
valueType: 'date',
width: '100%',
fieldProps: {
format: 'YYYY-MM-DD',
},
formItemProps: {
rules: [
{
required: true,
message: '此项为必填项',
},
],
},
colProps: {
span: 7,
},
},
{
title: '交货地点',
dataIndex: 'deliveryLocation',
colProps: {
span: 7,
},
},
],
},
```

### © 版本信息

- ProComponents 版本: [3.1.3-0]
- 浏览器环境 Google chrome
- 开发环境 [mac OS]

### 🚑 其他信息

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the supplied Schema Form configuration in ProComponents 3.1.3-0, focusing on the date field nested in formList and its submitted value. Compare the result with the expected YYYY-MM-DD format; done means the format is applied when the form is submitted.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.