import { withFormItem } from "../../dataSourceForm/utils";
import DatePickerWithMode from "./WithMode";
import dayjs from 'dayjs';
var DatePicker = withFormItem(DatePickerWithMode, {
  innerProps: {
    style: {
      width: '100%'
    }
  },
  otherFormItemProps: function otherFormItemProps(props) {
    return {
      normalize: function normalize(value) {
        return value && dayjs(value).format(props.submitFormat || "YYYY-MM-DD");
      },
      getValueProps: function getValueProps(value) {
        return {
          value: value && dayjs(value)
        };
      }
    };
  }
});
export default DatePicker;