Closed ggarg2 closed 7 years ago
I got an answer. Remove curly braces because handleConfirmDate method is passing two parameters in onConfirm. handleConfirmDate(){ this.props.onConfirm && this.props.onConfirm(this.state.startDate,this.state.untilDate); }
Instead of using onConfirm= {({startDate, untilDate}) => console.log("dates are ", startDate)}
use onConfirm= {(startDate, untilDate) => console.log("dates are ", startDate)}
@apaajabolehd please update readme
Thank you for figuring that out @ggarg2. I'll fix it immediately.
<DatepickerRange startDate= {this.props.startDate} untilDate= {this.props.endDate} dayHeadings= {['S', 'M', 'T', 'W', 'T', 'F', 'S']} maxMonth= {12} buttonColor= 'green' showReset= {true} showClose= {true} onClose= {this.props.toggleModal} onConfirm= {({startDate, untilDate}) => console.log("dates are ", startDate)} placeHolderStart= 'Check-in Date' placeHolderUntil= 'Check-out Date' selectedBackgroundColor= 'green' selectedTextColor= 'white' todayColor= 'green' />
this statement is logging when i am selecting date ==> 'dates are ', undefined.
Any Suggestions ?