import React from 'react';
import { isInvalidDate } from '../../utils/validate';
import FieldWrapper from './FieldWrapper';
import withField from './withField';
import DatePicker from './DatePicker'; // Date picker for redux-form using pikaday library

var FieldDate = function FieldDate(props) {
  var input = props.input,
      disabled = props.disabled,
      minDate = props.minDate;
  return React.createElement(FieldWrapper, props, React.createElement(DatePicker, {
    input: input,
    disabled: disabled,
    minDate: minDate
  }));
};

FieldDate.defaultProps = {
  disabled: false,
  minDate: null
};
var withReduxField = withField(isInvalidDate);
export default withReduxField(FieldDate);