Skip to content

Commit

Permalink
feat: expose DatePicker[showToday], ref: #3793
Browse files Browse the repository at this point in the history
  • Loading branch information
benjycui committed Nov 14, 2016
1 parent a1fe873 commit bbef274
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/date-picker/createPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default function createPicker(TheCalendar) {
return {
prefixCls: 'ant-calendar',
allowClear: true,
showToday: true,
};
},

Expand Down Expand Up @@ -113,6 +114,7 @@ export default function createPicker(TheCalendar) {

const calendar = (
<TheCalendar
{...calendarHandler}
disabledDate={props.disabledDate}
disabledTime={disabledTime}
locale={locale.lang}
Expand All @@ -123,7 +125,7 @@ export default function createPicker(TheCalendar) {
className={calendarClassName}
onOk={props.onOk}
format={props.format}
{...calendarHandler}
showToday={props.showToday}
/>
);

Expand Down
1 change: 1 addition & 0 deletions components/date-picker/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ The following APIs are shared by DatePicker, MonthPicker, RangePicker.
| open | open state of picker | bool | - |
| onOpenChange | a callback function, can be executed whether the popup calendar is popped up or closed | function(status) | - |
| 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) | - |

### MonthPicker
Expand Down
1 change: 1 addition & 0 deletions components/date-picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface SinglePickerProps {

export interface DatePickerProps extends PickerProps, SinglePickerProps {
showTime?: TimePickerProps | boolean;
showToday?: boolean;
open?: boolean;
toggleOpen?: (e: {open: boolean}) => void;
disabledDate?: (current: moment.Moment) => boolean;
Expand Down
1 change: 1 addition & 0 deletions components/date-picker/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ moment.locale('zh-cn');
| open | 控制弹层是否展开 | bool | - |
| onOpenChange | 弹出日历和关闭日历的回调 | function(status) ||
| showTime | 增加时间选择功能 | Object or Boolean | [TimePicker Options](/components/time-picker/#api) |
| showToday | 是否展示“今天”按钮 | Boolean | true |
| disabledTime | 不可选择的时间 | function(date) ||

### MonthPicker
Expand Down

0 comments on commit bbef274

Please sign in to comment.