fix placeholder

pull/540/head
afc163 9 years ago
parent ceb4761555
commit e42729f165

@ -5,7 +5,7 @@ import CalendarLocale from 'rc-calendar/lib/locale/en_US';
// 统一合并为完整的 Locale
let locale = objectAssign({}, GregorianCalendarLocale);
locale.lang = objectAssign({
placeholder: 'Please select a date'
placeholder: 'Select a date'
}, CalendarLocale);
// All settings at:

@ -8,7 +8,7 @@ const AntTimepicker = React.createClass({
getDefaultProps() {
return {
format: 'HH:mm:ss',
placeholder: '请选择时间',
placeholder: '',
prefixCls: 'ant-timepicker',
onChange() {},
locale: {},
@ -64,16 +64,17 @@ const AntTimepicker = React.createClass({
return locale;
},
render() {
const { format } = this.props;
const formatter = new DateTimeFormat(format);
const placeholder = this.props.placeholder || this.getLocale().lang.placeholder;
return (
<TimePicker
{...this.props}
inputClassName={`ant-input ${this.getSizeClass()}`}
formatter={formatter}
defaultValue={this.getDefaultValue(formatter)}
placeholder={placeholder}
onChange={this.handleChange}
/>
);

@ -1,12 +0,0 @@
import objectAssign from 'object-assign';
import GregorianCalendarLocale from 'gregorian-calendar/lib/locale/zh_CN';
import CalendarLocale from 'rc-time-picker/lib/locale/zh_CN';
// 统一合并为完整的 Locale
let locale = objectAssign({}, GregorianCalendarLocale);
locale.lang = objectAssign({}, CalendarLocale);
// All settings at:
// https://github.com/ant-design/ant-design/issues/424
export default locale;

@ -4,7 +4,9 @@ import TimepickerLocale from 'rc-time-picker/lib/locale/en_US';
// 统一合并为完整的 Locale
let locale = objectAssign({}, GregorianCalendarLocale);
locale.lang = objectAssign({}, TimepickerLocale);
locale.lang = objectAssign({
placeholder: 'Select a time'
}, TimepickerLocale);
// All settings at:
// https://github.com/ant-design/ant-design/issues/424

@ -4,7 +4,9 @@ import TimepickerLocale from 'rc-time-picker/lib/locale/zh_CN';
// 统一合并为完整的 Locale
let locale = objectAssign({}, GregorianCalendarLocale);
locale.lang = objectAssign({}, TimepickerLocale);
locale.lang = objectAssign({
placeholder: '请选择时间'
}, TimepickerLocale);
// All settings at:
// https://github.com/ant-design/ant-design/issues/424

Loading…
Cancel
Save