ant.design v5.2.0 - date.locale is not a function rewritten as: "ant.design v5.2.0 - date.locale is not a callable function"
P粉488464731
2023-08-25 09:05:00
<p>I have the following question:</p>
<p>I'm using version 5.2.0 of ant.design. When I use the <code><DatePicker></code> component using: </p> ;
<p>If I don't specify the default value as dayjs <code><form></code>, I don't get the error, but I don't get the prepopulated value in the date picker either. </p>
<p>What else can I try? </p>
<p>This is an excerpt from the source code:</p>
<pre class="brush:php;toolbar:false;"><Form
form={formRef}
onFinish={handleSubmit}
initialValues={{...collaboration, dueDate: dayjs(collaboration.dueDate)}}
>
<Form.Item label="DatePicker" name={"dueDate"} rules={[{ required: true, message: 'Please select time!' }]}>
<DatePicker style={{width: "100%"}}/>
</Form.Item>
</Form></pre>
This is a sandbox for this case: https://codesandbox.io/s/antd-reproduction-template-forked-4mv33s?file=/index.js
edit: Works fine in sandbox :D