[Solved] ant-design a-date-picker Error: date.locale is not a function

[Solved] Ant-Design A-Date-Picker Error: Date.locale Is Not A Function

date.locale is not a function

Original code:

<a-form-item label="Time From:" title="signTime">
                <a-date-picker placeholder="Please Select"  v-model:worth="formState.signTime" model="width:100%" />
              </a-form-item>

Correct code:

<a-form-item label="Time From:" title="signTime">
                <a-date-picker placeholder="Please Select" format="YYYY-MM-DD" valueFormat="YYYY-MM-DD" v-model:worth="formState.signTime" model="width:100%" />
              </a-form-item>

Summary: it’s worthwhile to add the time show format attribute and the ultimate worth format valueFormat attribute.

Leave a Reply

Your email address will not be published. Required fields are marked *