Skip to content

Commit

Permalink
fix(antd-components): fix timepicker format (#1069)
Browse files Browse the repository at this point in the history
  • Loading branch information
haipeng authored Nov 26, 2020
1 parent 62f7065 commit a5b1af9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/antd-components/src/time-picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ const transformMoment = (value) => {
}

const mapMomentValue = (props: any, fieldProps: any) => {
const { value } = props
const { value, format = 'HH:mm:ss' } = props
if (!fieldProps.editable) return props
try {
if (isStr(value) && value) {
props.value = moment(value, 'HH:mm:ss')
props.value = moment(value, format)
} else if (isArr(value) && value.length) {
props.value = value.map(
(item) => (item && moment(item, 'HH:mm:ss')) || ''
(item) => (item && moment(item, format)) || ''
)
}
} catch (e) {
Expand Down

0 comments on commit a5b1af9

Please sign in to comment.