utcOffset(X, true) manipulates caller instance
Open
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
https://github.com/iamkun/dayjs/blob/7151139f047a71c39cf63608c6aeb4f6876c8078/src/plugin/utc/index.js#L92
`utcOffset(X, true)` method does not clone before setting $offset, so caller dayjs object will be manipulated.
**Expected behavior**
`utcOffset(X, true)` should not manipulate the original instance.
**Information**
- Day.js Version 1.11.3
Contributor guide
Assessment
This issue has not been assessed yet.