提交 fb2e355f 编写于 作者: A afc163

Calendar locale prop should have priority

close #12706
上级 2c536660
......@@ -240,11 +240,23 @@ export default class Calendar extends React.Component<CalendarProps, CalendarSta
);
}
getDefaultLocale = () => {
const result = {
...enUS,
...this.props.locale,
};
result.lang = {
...result.lang,
...(this.props.locale || {}).lang,
};
return result;
}
render() {
return (
<LocaleReceiver
componentName="Calendar"
defaultLocale={enUS}
defaultLocale={this.getDefaultLocale}
>
{this.renderCalendar}
</LocaleReceiver>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册