Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
feat: add disabledTime api
Browse files Browse the repository at this point in the history
Signed-off-by: dangyuzheng <dang.yuzheng@xsky.com>
  • Loading branch information
dangyuzheng committed Aug 14, 2023
1 parent 2db8667 commit f04711e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/RangePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export default class RangePicker extends React.PureComponent<RangePickerProps, R
);
};
renderCalendar = () => {
const { onOk, format, disabledDate } = this.props;
const { onOk, format, disabledDate, disabledTime } = this.props;
return (
<RangeCalendar
seperator={this.seperator}
Expand All @@ -179,6 +179,7 @@ export default class RangePicker extends React.PureComponent<RangePickerProps, R
renderFooter={this.renderFooter}
showToday={false}
disabledDate={disabledDate}
disabledTime={disabledTime}
/>
);
};
Expand Down
2 changes: 2 additions & 0 deletions src/interface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ export interface RangePickerProps {
disabledDate?: (current: Moment) => Boolean;
/** 是否禁用当前时间的选择 */
disabledDateTime?: (value: Moment[] | string[]) => Moment[] | string[];
/** 一个函数,根据rc-time-picker返回一个成员为disabledHours/disabledMinutes/disabledSeconds的对象 */
disabledTime?: (current: Moment) => Object;
}

export interface RangePickerState {
Expand Down

0 comments on commit f04711e

Please sign in to comment.