mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
fix RangePicker placeholder not working bug
This commit is contained in:
parent
a8c4f53922
commit
f3df6205a4
@ -111,10 +111,10 @@ export default class RangePicker extends React.Component<any, any> {
|
||||
calendarHandler = {};
|
||||
}
|
||||
|
||||
const startPlaceholder = ('startPlaceholder' in this.props)
|
||||
? props.startPlaceholder : locale.lang.rangePlaceholder[0];
|
||||
const endPlaceholder = ('endPlaceholder' in props)
|
||||
? props.endPlaceholder : locale.lang.rangePlaceholder[1];
|
||||
const startPlaceholder = ('placeholder' in props)
|
||||
? props.placeholder[0] : locale.lang.rangePlaceholder[0];
|
||||
const endPlaceholder = ('placeholder' in props)
|
||||
? props.placeholder[1] : locale.lang.rangePlaceholder[1];
|
||||
|
||||
const calendar = (
|
||||
<RangeCalendar
|
||||
|
@ -46,6 +46,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker.
|
||||
| getCalendarContainer | to set the container of the floating layer, while the default is to create a `div` element in `body` | function(trigger) | - |
|
||||
| open | open state of picker | bool | - |
|
||||
| onOpenChange | a callback function, can be executed whether the popup calendar is popped up or closed | function(status) | - |
|
||||
| placeholder | placeholder of date input | string or array (RangePicker) | - |
|
||||
|
||||
### DatePicker
|
||||
|
||||
@ -58,7 +59,6 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker.
|
||||
| showTime | to provide an additional time selection | Object/Boolean | [TimePicker Options](/components/time-picker/#api) |
|
||||
| showToday | whether to show "Today" button | Boolean | true |
|
||||
| disabledTime | to specify the time that cannot be selected | function(date) | - |
|
||||
| placeholder | placeholder of date input | string | - |
|
||||
|
||||
### MonthPicker
|
||||
|
||||
@ -70,7 +70,6 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker.
|
||||
| onChange | a callback function, can be executed when the selected time is changing | function(date: moment, dateString: string) | - |
|
||||
| monthCellContentRender | Custom month cell render method | function | 无 |
|
||||
| cellContentRender | Custom month cell content render method,the content will be appended to the cell. | function | 无 |
|
||||
| placeholder | placeholder of date input | string | - |
|
||||
|
||||
### RangePicker
|
||||
|
||||
@ -83,8 +82,6 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker.
|
||||
| showTime | to provide an additional time selection | Object/Boolean | [TimePicker Options](/components/time-picker/#api) |
|
||||
| disabledTime | to specify the time that cannot be selected | function(dates: [moment, moment], partial: `'start'|'end'`) | - |
|
||||
| ranges | preseted ranges for quick selection | Object { [range: string]: [moment, moment] } | - |
|
||||
| startPlaceholder | placeholder of start input | string | - |
|
||||
| endPlaceholder | placeholder of end input | string | - |
|
||||
|
||||
<style>
|
||||
.code-box-demo .ant-calendar-picker {
|
||||
|
@ -47,6 +47,7 @@ moment.locale('zh-cn');
|
||||
| getCalendarContainer | 定义浮层的容器,默认为 body 上新建 div | function(trigger) | 无 |
|
||||
| open | 控制弹层是否展开 | bool | - |
|
||||
| onOpenChange | 弹出日历和关闭日历的回调 | function(status) | 无 |
|
||||
| placeholder | 输入框提示文字 | string or array (RangePicker) | - |
|
||||
|
||||
### DatePicker
|
||||
|
||||
@ -59,7 +60,6 @@ moment.locale('zh-cn');
|
||||
| showTime | 增加时间选择功能 | Object or Boolean | [TimePicker Options](/components/time-picker/#api) |
|
||||
| showToday | 是否展示“今天”按钮 | Boolean | true |
|
||||
| disabledTime | 不可选择的时间 | function(date) | 无 |
|
||||
| placeholder | 输入框提示文字 | string | - |
|
||||
|
||||
### MonthPicker
|
||||
|
||||
@ -71,7 +71,6 @@ moment.locale('zh-cn');
|
||||
| onChange | 时间发生变化的回调,发生在用户选择时间时 | function(date: moment, dateString: string) | 无 |
|
||||
| monthCellContentRender | 自定义的月份渲染方法 | function | 无 |
|
||||
| cellContentRender | 自定义的月份渲染方法,内容会被附加在月份后面 | function | 无 |
|
||||
| placeholder | 输入框提示文字 | string | - |
|
||||
|
||||
### RangePicker
|
||||
|
||||
@ -84,8 +83,6 @@ moment.locale('zh-cn');
|
||||
| showTime | 增加时间选择功能 | Object or Boolean | [TimePicker Options](/components/time-picker/#api) |
|
||||
| disabledTime | 不可选择的时间 | function(dates: [moment, moment], partial: `'start'|'end'`) | 无 |
|
||||
| ranges | 预设事件范围快捷选择 | Object { [range: string]: [moment, moment] } | 无 |
|
||||
| startPlaceholder | 输入框提示文字 | string | - |
|
||||
| endPlaceholder | 输入框提示文字 | string | - |
|
||||
|
||||
<style>
|
||||
.code-box-demo .ant-calendar-picker {
|
||||
|
Loading…
Reference in New Issue
Block a user