Wrong behaviour of isBefore when using timezones
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Comparing two dayjs instances in a specific timezone wich are 1 minute apart a before each other.
```javascript
var d1 = dayjs().tz('Europe/Berlin').year(2023).month(3).date(10).hour(0).minute(0).second(0).millisecond(0)
var d2 = d1.subtract(1, 'minute')
d1.isBefore(d2)
> true
d2.isBefore(d1)
> true
```
This is not happening when you are not using a timezone:
```javascript
var d1 = dayjs().year(2023).month(3).date(10).hour(0).minute(0).second(0).millisecond(0)
var d2 = d1.subtract(1, 'minute')
d1.isBefore(d2)
> false
d2.isBefore(d1)
> true
```
**Expected behavior**
The later instance should return false when using `isBefore`.
**Information**
- Day.js Version v1.11.5
- OS: macOS
- Browser Chrome 108.0.5359.124
- Time zone: GMT+0200
Contributor guide
Assessment
This issue has not been assessed yet.