fix(DatePicker): showTime locale problem

close #1356
This commit is contained in:
afc163 2016-04-07 17:44:13 +08:00
parent ed4d2460fe
commit f726979af9
4 changed files with 10 additions and 4 deletions

View File

@ -73,7 +73,8 @@ export default React.createClass({
if (showTime) {
timePicker = (<TimePicker
prefixCls="ant-time-picker"
placeholder={locale.lang.timePlaceholder}
placeholder={locale.timePickerLocale.placeholder}
locale={locale.timePickerLocale}
transitionName="slide-up" />);
}

View File

@ -60,7 +60,8 @@ function createPicker(TheCalendar, defaultFormat) {
const timePicker = this.props.showTime ? (<TimePicker
prefixCls="ant-time-picker"
placeholder={locale.lang.timePlaceholder}
placeholder={locale.timePickerLocale.placeholder}
locale={locale.timePickerLocale}
transitionName="slide-up" />)
: null;

View File

@ -1,14 +1,16 @@
import objectAssign from 'object-assign';
import GregorianCalendarLocale from 'gregorian-calendar/lib/locale/en_US';
import CalendarLocale from 'rc-calendar/lib/locale/en_US';
import TimePickerLocale from '../../time-picker/locale/en_US';
// 统一合并为完整的 Locale
let locale = objectAssign({}, GregorianCalendarLocale);
locale.lang = objectAssign({
placeholder: 'Select date',
timePlaceholder: 'Select time',
}, CalendarLocale);
locale.timePickerLocale = objectAssign({}, TimePickerLocale);
// All settings at:
// https://github.com/ant-design/ant-design/issues/424

View File

@ -1,14 +1,16 @@
import objectAssign from 'object-assign';
import GregorianCalendarLocale from 'gregorian-calendar/lib/locale/zh_CN';
import CalendarLocale from 'rc-calendar/lib/locale/zh_CN';
import TimePickerLocale from '../../time-picker/locale/zh_CN';
// 统一合并为完整的 Locale
let locale = objectAssign({}, GregorianCalendarLocale);
locale.lang = objectAssign({
placeholder: '请选择日期',
timePlaceholder: '请选择时间',
}, CalendarLocale);
locale.timePickerLocale = objectAssign({}, TimePickerLocale);
// should add whitespace between char in Button
locale.lang.ok = '确 定';