iamkun / iamkun/dayjs

Error in endOf week function

Open
#2,404 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
EndOf('week') returns an error date when parsing with a parameter.
`dayjs('2023-07-31').endOf('week').fmYYYYMMDDHHmmss() = 2023-07-30 23:59:59`

**Expected behavior**
EndOf('week') return correct date.
`dayjs('2023-07-31').endOf('week').fmYYYYMMDDHHmmss() = 2023-08-06 23:59:59`

**Information**
- Day.js Version [e.g. v1.0.0]
- OS: [e.g. iOS]
- Browser [e.g. chrome 62]
- Time zone: [e.g. GMT-07:00 DST (Pacific Daylight Time)]

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the shown dayjs('2023-07-31').endOf('week') expression and inspect the endOf('week') entry point. Check how the week boundary is determined when the formatting parameter is used; done means the expression returns 2023-08-06 23:59:59 as expected.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.