jest dayjs.utcOffset return the wrong result
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.8k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
when i use jest to test dayjs. i have a issue
The code
const smallerValue = 1638288000000
const utcOffset = UTF-2
const smallerDay = dayjs(smallerValue)
const smallerDayUtc = smallerDay.utcOffset(utcOffset, false)
return smallerDayUtc.format('YYYY/MM/DD')
Expected behavior
In my components the smallerDayUtc return Dayjs
but in the test.tsx return 480
Information
- Day.js Version [v1.10.7]
- OS: [macOS 10.15.7]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the shown dayjs.utcOffset example in the mentioned test.tsx under Jest, using Day.js v1.10.7, and compare it with the component behavior. Trace the utcOffset result and confirm whether the test returns 480 instead of a Day.js value; done means the behavior is understood and the expected result is consistent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100