chain call functions dayjs、tz、hour、minute return incorrectly
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
```
const d1 = dayjs('2024-04-09T22:30:50Z').tz("UTC").hour(10).minute(10).format() // '2024-04-09T10:10:50Z'
const value1 = dayjs('2024-04-09T22:30:50Z').tz("UTC").hour(10).minute(10).valueOf() // 1712686250000
const d2 = dayjs(1712686250000).tz("UTC").format() // '2024-04-09T18:10:50Z'
```
**Expected behavior**
excepte d1 === d2
**Information**
- Day.js Version 1.11.10
- OS: MacOs
- Browser : chrome 版本 123.0.6312.107(正式版本) (arm64)
- Time zone: Asia/Shanghai
Contributor guide
Research direction
Start by reproducing the provided dayjs, tz, hour, minute, format, and valueOf chain in a local test. Trace the timezone-related implementation and existing tests to determine why the formatted value and timestamp disagree; done means d1 and d2 produce the same instant and the regression is covered by a test.
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
- 45/100