Skip to content

Commit

Permalink
fix RangePicker placeholder not working bug
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Nov 23, 2016
1 parent a8c4f53 commit f3df620
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
8 changes: 4 additions & 4 deletions components/date-picker/RangePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions components/date-picker/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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 {
Expand Down
5 changes: 1 addition & 4 deletions components/date-picker/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ moment.locale('zh-cn');
| getCalendarContainer | 定义浮层的容器,默认为 body 上新建 div | function(trigger) ||
| open | 控制弹层是否展开 | bool | - |
| onOpenChange | 弹出日历和关闭日历的回调 | function(status) ||
| placeholder | 输入框提示文字 | string or array (RangePicker) | - |

### DatePicker

Expand All @@ -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

Expand All @@ -71,7 +71,6 @@ moment.locale('zh-cn');
| onChange | 时间发生变化的回调,发生在用户选择时间时 | function(date: moment, dateString: string) ||
| monthCellContentRender | 自定义的月份渲染方法 | function ||
| cellContentRender | 自定义的月份渲染方法,内容会被附加在月份后面 | function ||
| placeholder | 输入框提示文字 | string | - |

### RangePicker

Expand All @@ -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 {
Expand Down

1 comment on commit f3df620

@afc163
Copy link
Member Author

@afc163 afc163 commented on f3df620 Apr 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.