Convert dayjs format to date

Table of contents

method one:

​Editing method two:


This project was screened by the front-end when filtering the order time, and was developed using adt-design-pro. A problem was encountered when using the date component. The component returned:

But what I need is year-month-day. After searching and trying, it still doesn’t work in the end.
 

const dateFormat = 'YYYY/MM/DD';



dayjs(dayjs格式, dateFormat)

I printed it out and found that there was no change. I tried again and finally found the answer in gpt:

method one:

Method Two:

dayjs(e[0].$d).format('YYYY-MM-DD'));

use:

Add .format('YYYY-MM-DD') to achieve the effect

Guess you like

Origin blog.csdn.net/m0_72196169/article/details/132612447