title: Properly setting Antd DatePicker initial value using getFieldDecorator
body: <p>Trying to set default field value to <strong>antd</strong> <code>Datepicker</code> using <code>getFieldDecorator</code> two-way binding. </p>
  
  <p><code>form.getFieldValue('joiningDate')</code> is a timestamp value</p>
  
  <p>1st try</p>
  
  <pre><code>&lt;Form.Item &gt;
    {getFieldDecorator('joiningDate', { initialValue: moment.unix(form.getFieldValue('joiningDate')) })(
     &lt;DatePicker disabled={inProgress}&gt;&lt;/DatePicker&gt;
    )}
  &lt;/Form.Item&gt;
  </code></pre>
  
  <p>2nd try</p>
  
  <pre><code>&lt;Form.Item &gt;
    {getFieldDecorator('joiningDate', { initialValue: moment()) })(
     &lt;DatePicker  disabled={inProgress}&gt;&lt;/DatePicker&gt;
    )}
  &lt;/Form.Item&gt;
  </code></pre>
  
  <p>Both the above method throws following error when <code>joiningDate</code> has a value - </p>
  
  <p><a href="https://i.stack.imgur.com/iNRPt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iNRPt.png" alt="enter image description here"></a></p>
  
  <p>If <code>joiningDate</code> is null there is no error and using 2nd method by default it should display today's date. </p>
  
  <p>Update:</p>
  
  <p>If I precreate moment object of <code>joiningDate</code>, then <code>DatePicker</code> works. But I want to format it only at the time of binding to Datepicker. Seems the <code>initialValue</code> prop has no effect.</p>
  
  <pre><code>export default function App() {
    return (
      &lt;FlexBox&gt;
        &lt;FormContainer data={{ joiningDate: Date.now() }} /&gt;
      &lt;/FlexBox&gt;
    );
  }
  const MyForm = ({ form }) =&gt; {
    const { getFieldDecorator } = form;
    return (
      &lt;Form&gt;
        &lt;Form.Item&gt;
          {getFieldDecorator("joiningDate", { initialValue: moment() })(
            &lt;DatePicker /&gt;
          )}
        &lt;/Form.Item&gt;
      &lt;/Form&gt;
    );
  };
  
  const FormContainer = Form.create({
    name: "advanced_search",
    mapPropsToFields({ data }) {
      if (!data) return;
      let precreatedFields = {
        joiningDate: Form.createFormField({
          value: data["joiningDate"]
        })
      };
  
      //more fields are removed
      return precreatedFields;
    }
  })(MyForm);
  </code></pre>
  
  <p>Code <a href="https://codesandbox.io/s/styled-antd-react-starter-hvb4o?fontsize=14" rel="nofollow noreferrer">example</a></p>
  
  <p><em>NB: Similar question(<a href="https://stackoverflow.com/questions/49841281/using-datepicker-with-form-formitem-in-antd-design-react">Using DatePicker with Form FormItem in antd design react</a>). It had different error "I get async validator saying 'publishDate is not a string"</em> </p>