Dayjs: No ordinal number spelling after the day automatically when using format()

Created on 7 May 2018  路  3Comments  路  Source: iamkun/dayjs

Using D or DD for the day format string doesn't add the ordinal number spelling such as 1st, 2nd, 3rd, 4th, etc.

dayjs('2016-01-24 01:23:45').format('MMMM D YYYY, h:mm:ss a')

outputs:

"January 24 2016, 1:23:45 am"

We need a way to automatically detect which ordinal number spelling goes after the day

Most helpful comment

@ljmerza
We have this now.
ordinal number support added in release 1.6 馃帄 馃帀 through AdvancedFormat Plugin

check AdvancedFormat Plugin

All 3 comments

Currently we support.

Unit| - | -
-- | -- | --
D | 1-31 | The day of the month
DD | 01-31 | The day of the month, 2-digits

Please check our docs.

@ljmerza
We have this now.
ordinal number support added in release 1.6 馃帄 馃帀 through AdvancedFormat Plugin

check AdvancedFormat Plugin

It might be worth making this clearer? Sorry as I didn't understand this :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

antony picture antony  路  5Comments

eugeneoshepkov picture eugeneoshepkov  路  3Comments

scottsandersdev picture scottsandersdev  路  3Comments

Newbie012 picture Newbie012  路  4Comments

Wyzix33 picture Wyzix33  路  4Comments