Dayjs: r.ordinal is not a function at advanceFormat.js
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
When I try to format the date to show ordinal for date it breaks the app and shows error r.ordinal is not a function.
Code:
import dayjs from 'dayjs';
import advancedFormat from 'dayjs/plugin/advancedFormat';
dayjs.extend(advancedFormat);
const formattedDate = dayjs(endDate).format("MMMM Do, YYYY");
**Expected behavior**
It should format date in this format => December 31st, 2022
**Information**
- Day.js Version [1.10.7]
- OS: [iOS]
- Browser [chrome [100.0.4896.127]]

Contributor guide
Research direction
Start by reproducing the error with the advancedFormat plugin and the `dayjs(endDate).format("MMMM Do, YYYY")` call described in the issue. Inspect the advancedFormat.js path mentioned in the title; done means the call no longer throws and produces the expected December 31st, 2022 format.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100