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
P粉488464731 2023-08-25 09:05:00
0
1
529
<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>
P粉488464731
P粉488464731

reply all(1)
P粉242126786

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!