mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 21:19:37 +08:00
add interopDefault (#16110)
This commit is contained in:
parent
3fba56ec90
commit
7db67ae8f1
@ -4,6 +4,7 @@ import TimePickerPanel from 'rc-time-picker/lib/Panel';
|
||||
import classNames from 'classnames';
|
||||
import * as moment from 'moment';
|
||||
import enUS from './locale/en_US';
|
||||
import interopDefault from '../_util/interopDefault';
|
||||
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
||||
import { generateShowHourMinuteSecond } from '../time-picker';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
@ -52,7 +53,7 @@ function checkValidate(value: any, propName: string) {
|
||||
if (!val) return;
|
||||
|
||||
warning(
|
||||
!moment.isMoment(val) || val.isValid(),
|
||||
!interopDefault(moment).isMoment(val) || val.isValid(),
|
||||
'DatePicker',
|
||||
`\`${propName}\` provides invalidate moment time. If you want to set empty value, use \`null\` instead.`,
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user