When setting last day of the month then setting month => first day of next month
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
`dayjs().date(31).month(4)`
i'm just running this in the chrome console

**Expected behavior**
I'm expecting having the 31th of May.
**Workaround**
If i do this `dayjs().month(4).date(31)` it works fine
**Information**
- Day.js Version 1.11.6
- OS: MACos ventura 13.2.1
- Browser Chrome 111 arm
- Time zone: GMT+2
Contributor guide
Research direction
Start by reproducing `dayjs().date(31).month(4)` and compare it with the reported workaround, `dayjs().month(4).date(31)`. Trace the `date()` and `month()` entry points and their existing tests; done means setting the month after the day preserves the expected May 31 date without breaking other month-boundary cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100