Skip to content

Commit

Permalink
test: fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
benjycui committed Oct 24, 2017
1 parent 9181db8 commit 67be1ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion components/calendar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down Expand Up @@ -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>
Expand Down
7 changes: 6 additions & 1 deletion components/date-picker/wrapPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 67be1ea

Please sign in to comment.