Formatting ordinal dates doesn't work
See original GitHub issueDescribe the bug
The Do formatting option from the AdvancedFormat plugin doesn’t appear to work since upgrading to v1.8.19
Expected behavior
Given this code:
import advancedFormat from 'dayjs/plugin/advancedFormat'
dayjs.extend(advancedFormat)
dayjs('2020-01-06').format('Do MMM YYYY')
I expect the output: 6th Jan 2020, but instead I’m seeing 6o Jan 2020. This seemed to work fine in v1.8.18, but appears to be broken since upgrading to v1.8.19.
Information
- Day.js Version: 1.8.19
This regression was picked up by our test suite, so I haven’t included a Browser.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How do you format the day of the month to say "11th", "21st" or ...
Simply create a day of some format but include %s%s to add the day and ordinal later. ZonedDateTime ldt = ZonedDateTime.now(); String format...
Read more >Display Ordinal Number In Dates - Microsoft Community
I want to change the number format for cells to display a date as an ordinal number (ex "May 4th", "Monday, June 21st",...
Read more >Excel Dates Won't Change Format - Contextures Blog
Why won't the dates change format? Even though they look like dates, Excel sees them as text, and Excel can't apply number formatting...
Read more >Dates: How to Write Correctly - The Editor's Manual
Don't use ordinal numbers in dates in formal texts (May 1st, 2022 ). You may also show the day of the week (Sunday,...
Read more >How to convert date to ordinal date format in Excel?
As we all known, you can format date as multiple format in Excel, such as 1/1/2016, 1-Jan-16 and so on. However, have you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks @iamkun the problem was that the advancedFormat plugin was not included.
import advancedFormat from "dayjs/plugin/advancedFormat";I am not sure if this has caught anybody else out… sorry to use your time up. I think I would have found this information in the table very helpful! 😃import advancedFormat from "dayjs";doesn’t seem to be working.import advancedFormat from "dayjs/plugin/advancedFormat"worked fine.