Skip to content

Commit

Permalink
update: onSelect API, add state data.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhang740 committed Jan 17, 2018
1 parent 911c95d commit 7e40ef5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default class Calendar extends React.PureComponent<PropsType, StateType>
const { startDate, endDate } = this.state;
const { onSelect } = this.props;
if (onSelect) {
let value = onSelect(date);
let value = onSelect(date, [startDate, endDate]);
if (value) {
this.shortcutSelect(value[0], value[1]);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/CalendarProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default interface PropsType {
/** 选择区间包含不可用日期 */
onSelectHasDisableDate?: (date: Date[]) => void;
/** 选择日期回调,如果有返回值,选择范围将使用返回值 */
onSelect?: (date: Date) => SelectDateType | void;
onSelect?: (date: Date, state?: [Date | undefined, Date | undefined]) => SelectDateType | void;
/** 行大小,default: normal */
rowSize?: 'normal' | 'xl';

Expand Down

0 comments on commit 7e40ef5

Please sign in to comment.