Skip to content

Commit

Permalink
fix(DatePicker): date range picker select time error
Browse files Browse the repository at this point in the history
  • Loading branch information
myronliu347 committed Mar 6, 2019
1 parent d39a9ca commit 59eaa9c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/date-picker/module/panel-footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class PanelFooter extends React.PureComponent {
locale,
panel,
value,
disabledOk,
onPanelChange,
onOk,
} = this.props;
Expand All @@ -44,7 +45,11 @@ class PanelFooter extends React.PureComponent {
{panelBtnLabel}
</Button>
) : null}
<Button {...sharedBtnProps} onClick={onOk}>
<Button
{...sharedBtnProps}
disabled={disabledOk || !value}
onClick={onOk}
>
{locale.ok}
</Button>
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/date-picker/range-picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,11 @@ export default class RangePicker extends Component {
<PanelFooter
prefix={prefix}
value={state.startValue && state.endValue}
disabledOk={
!state.startValue ||
!state.endValue ||
state.startValue.valueOf() > state.endValue.valueOf()
}
locale={locale}
panel={state.panel}
onPanelChange={showTime ? this.changePanel : null}
Expand Down

0 comments on commit 59eaa9c

Please sign in to comment.