Skip to content

Commit

Permalink
fix calendar container props
Browse files Browse the repository at this point in the history
  • Loading branch information
thg303 committed Aug 10, 2017
1 parent e7dd109 commit 041807f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ export default class DatePicker extends Component {
renderCalendar() {
const { momentValue } = this.state;
const { timePickerComponent: TimePicker, onChange, min, max, defaultMonth, calendarStyles, calendarContainerProps } = this.props;

const updatedProps = {...calendarContainerProps,
onSelect: (selected) => {this.handleSelectDay.bind(this)(selected); calendarContainerProps.hasOwnProperty('onSelect') && calendarContainerProps.onSelect(selected)},
onClickOutside: () => {this.handleClickOutsideCalendar(); calendarContainerProps.hasOwnProperty('onClickOutside') && calendarContainerProps.onClickOutside()}
}
return (
<div>
<Calendar
Expand All @@ -162,8 +165,7 @@ export default class DatePicker extends Component {
onClickOutside={this.handleClickOutsideCalendar.bind(this) }
outsideClickIgnoreClass={outsideClickIgnoreClass}
styles={calendarStyles}
containerProps={calendarContainerProps}
>
{...updatedProps}>
{
TimePicker ? (
<TimePicker
Expand Down

0 comments on commit 041807f

Please sign in to comment.