add interopDefault (#16110)

This commit is contained in:
zombieJ 2019-04-16 11:39:43 +08:00 committed by GitHub
parent 3fba56ec90
commit 7db67ae8f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.`,
);