Skip to content

Commit

Permalink
fix: 620/617 (#621)
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
JohnIsOnTheRoad authored Jan 18, 2020
1 parent 1ff5f8b commit 6ca8809
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
28 changes: 13 additions & 15 deletions packages/antd/src/fields/date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,20 @@ const transformMoment = (value, format = 'YYYY-MM-DD HH:mm:ss') => {
}

const mapMomentValue = props => {
const { value, showTime = false, disabled = false } = props
const { value, showTime = false } = props
try {
if (!disabled) {
if (isStr(value) && value) {
props.value = moment(
value,
showTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'
)
} else if (isArr(value) && value.length) {
props.value = value.map(
item =>
(item &&
moment(item, showTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD')) ||
''
)
}
if (isStr(value) && value) {
props.value = moment(
value,
showTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'
)
} else if (isArr(value) && value.length) {
props.value = value.map(
item =>
(item &&
moment(item, showTime ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD')) ||
''
)
}
} catch (e) {
throw new Error(e)
Expand Down
2 changes: 2 additions & 0 deletions packages/antd/src/fields/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const FormTableField = styled(
renderMoveUp,
renderEmpty,
renderExtraOperations,
operationsWidth,
operations,
dragable,
...componentProps
Expand Down Expand Up @@ -90,6 +91,7 @@ const FormTableField = styled(
...operations,
key: 'operations',
dataIndex: 'operations',
width: operationsWidth || 200,
render: (value: any, record: any, index: number) => {
return (
<Form.Item>
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/fields/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ const FormTableField = styled(
}, [])
: renderColumns(schema.items)}
<ArrayList.Item
width={200}
width={operationsWidth || 200}
lock="right"
{...operations}
key="operations"
Expand Down

0 comments on commit 6ca8809

Please sign in to comment.