Skip to content

Commit

Permalink
made the changes suggested and squashed all the previous commits.
Browse files Browse the repository at this point in the history
  • Loading branch information
akshatgupta committed Sep 11, 2016
1 parent e0bb942 commit a9681e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/DateRangePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const defaultProps = {
numberOfMonths: 2,
showClearDates: false,
disabled: false,
hidePickerOnClear: false,

orientation: HORIZONTAL_ORIENTATION,
withPortal: false,
Expand Down Expand Up @@ -223,8 +224,11 @@ export default class DateRangePicker extends React.Component {
}

clearDates() {
this.props.onDatesChange({ startDate: null, endDate: null });
this.props.onFocusChange(START_DATE);
const { onDatesChange, hidePickerOnClear, onFocusChange } = this.props;
onDatesChange({ startDate: null, endDate: null });
if (!hidePickerOnClear) {
onFocusChange(START_DATE);
}
}

doesNotMeetMinimumNights(day) {
Expand Down
1 change: 1 addition & 0 deletions src/shapes/DateRangePickerShape.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default {
isDayBlocked: PropTypes.func,
isOutsideRange: PropTypes.func,
enableOutsideDays: PropTypes.bool,
hidePickerOnClear: PropTypes.bool,
numberOfMonths: PropTypes.number,
showClearDates: PropTypes.bool,
disabled: PropTypes.bool,
Expand Down

0 comments on commit a9681e3

Please sign in to comment.