isSame with itself is false during DST
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Comparing a date with itself (`d.isSame(d)`) returns false if the date is during daylight saving time.
```
// Running node with TZ='Europe/Zurich'
d = dayjs.tz("2021-10-01 00:00:00", "Europe/Athens")
d.isSame(d) // returns false
```
A test project to reproduce the bug can be found at https://github.com/faberchri/dayjs_bugs
The bug does not occur if node runs with `TZ='UTC'`.
**Expected behavior**
Comparing a date to itself with `isSame` should always return true.
**Information**
- Day.js Version 1.10.7
- OS: macOS 11.6.1
- node v16.13.0
- Time zone: "Europe/Zurich"
Contributor guide
Research direction
Start with the linked dayjs_bugs reproduction project and run the example under TZ='Europe/Zurich', comparing it with TZ='UTC'. Trace the isSame behavior for the Europe/Athens date; done means d.isSame(d) returns true during daylight saving time without regressing the UTC case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100