I am using react-datetime. when select first its returning undefined value if i select date second time its returning date which i selected previous time.Can any one fix this for me. thanks in advance.
Here is my code:
handleChange(date)
{
console.log("this.state.datetime",$('.rdtOpen>input').val());
this.setState({"customerDOB":date.utc().format('MM/DD/YYYY')})
console.log(date.utc().format('MM/DD/YYYY'));
}
<Datetime dateFormat="MM/DD/YYYY" value ={this.state.datetime} id="datefield" onChange={this.handleChange} inputProps={{ placeholder: 'MM/DD/YYYY'}} timeFormat={false} />