I have a Signup form that takes a date as input.
The code of my date input is:
birthDate: new Date(),
this.handleSubmit = this.handleSubmit.bind(this);
this.handledChange = this.handledChange.bind(this);
handledChange(date) {
this.setState({
birthDate: date
});
}
<ControlLabel>Date de naissance</ControlLabel>
<FormGroup controlId="birthDate" bsSize="large">
<FormControl
autoFocus
type="date"
value={this.state.birthDate}
onChange={this.handledChange}
/>
</FormGroup>
When I submit it, the input date is undefined on the console.
I want it in the format : YYYY-MM-DD
How can I fix that please?