nz-date-picker format datetime is not working in Angular CLI
Dung Do Tien Dec 31 2020 36
I'm working with angular11 and AntDesign Zoro version 11.0. I'm using nz-date-picker control with nzFormat="dd/MM/yyyy" but when I'm using FormBuilder.patchValue to set the date format for this control but it not working.
This is my code:
- updateTime: "2020-12-30T21:24:20.7403313+07:00"
- updateUserId: null
- id: 1
Have 1 answer(s) found.
- 0
I think the problem is here:
"updateTime": "2020-12-30T21:24:20.7403313+07:00"
Your service returns the type of moment, but its ant-input is a date data-type. So you need to convert from moment to date.
try this:
updateTime: moment(new Date()).format('DD/MM/YYYY'),
Dũng Đô La Dec 30 2020
* Type maximum 2000 characters.
* All comments have to wait approved before display.
* Please polite comment and respect questions and answers of others.