Dayjs: How to parse date with a given format?

Created on 30 Jul 2018  路  4Comments  路  Source: iamkun/dayjs

This works pretty well in momentjs

moment('27/08/2018', 'DD/MM/YYYY')

How can we make it work in dayjs?

This fails with the following error message -

dayjs('27/08/2018', 'DD/MM/YYYY')
TypeError: Cannot create property 'date' on string 'DD/MM/YYYY'

Most helpful comment

Any update on this? Pretty essential feature for people outside the US.

All 4 comments

Any update on this? Pretty essential feature for people outside the US.

Agree that this is needed. Do a lot of work with dates and would not move from moment without this feature. Lib looks nice.

This has been already requested as #136.

:tada: CustomParseFormat plugin is supported and included in version 1.8.0 :tada:

The release is available on:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Sunrise1970 picture Sunrise1970  路  4Comments

fes300 picture fes300  路  5Comments

Newbie012 picture Newbie012  路  4Comments

sheffieldnick picture sheffieldnick  路  5Comments

fundon picture fundon  路  5Comments