score:0

<Field
  name="date_of_birth"
  component={datePicker}
  type="text"
  selected={this.state.date_of_birth}
  onChange={this.handleChange.bind(this)}
  className="form-control"
/>

score:0

    class DateField extends Component {

      render() {
        const {
          input,
          meta: { error, touched }, 
        } = this.props;

        return (
          <div>
             <DatePicker
               {...input}
               dateForm="MM/DD/YYYY"
               selected={input.value && input.value}
               onChange={time => {
                input.value = time ? time : null;
               }}
               onBlur={() => input.onBlur(input.value)}
             />
            {touched && error && <span className="error-block">{error} 
          </span>}
        </div>
        );
      }
    }

export default DateField;

score:2

<DatePicker 
    {...input} 
    value = {moment(input.value).format('MM-YYYY')} 
    dateForm = "MM/DD/YYYY" 
    selected = {input.value ? moment(input.value) : null} 
/>

Related Query

More Query from same tag