Browse Source

test: fix CI

pull/7985/head 3.0.0-alpha.18
Benjy Cui 7 years ago
parent
commit
67be1eafa9
  1. 7
      components/calendar/index.tsx
  2. 7
      components/date-picker/wrapPicker.tsx

7
components/calendar/index.tsx

@ -120,6 +120,11 @@ export default class Calendar extends React.Component<CalendarProps, CalendarSta
);
}
getDefaultLocale() {
const locale = require('./locale/en_US');
return locale.default || locale;
}
setValue = (value, way: 'select' | 'changePanel') => {
if (!('value' in this.props)) {
this.setState({ value });
@ -208,7 +213,7 @@ export default class Calendar extends React.Component<CalendarProps, CalendarSta
return (
<LocaleReceiver
componentName="Calendar"
defaultLocale={() => require('./locale/en_US')}
defaultLocale={this.getDefaultLocale}
>
{this.renderCalendar}
</LocaleReceiver>

7
components/date-picker/wrapPicker.tsx

@ -54,6 +54,11 @@ export default function wrapPicker(Picker, defaultFormat?: string): any {
}
}
getDefaultLocale() {
const locale = require('./locale/en_US');
return locale.default || locale;
}
renderPicker = (locale, localeCode) => {
const props = this.props;
const { prefixCls, inputPrefixCls } = props;
@ -102,7 +107,7 @@ export default function wrapPicker(Picker, defaultFormat?: string): any {
return (
<LocaleReceiver
componentName="DatePicker"
defaultLocale={() => require('./locale/en_US')}
defaultLocale={this.getDefaultLocale}
>
{this.renderPicker}
</LocaleReceiver>

Loading…
Cancel
Save