iamkun / iamkun/dayjs

isSame() producing strange results

Open
#1,189 13 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
48.7k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

dayjs is making me feel like I'm going insane!

```javascript
dayjs('2020-10-13T03:30:00.000Z').isSame('2020-10-12T04:53:43.427Z', 'day') // true
dayjs('2020-10-13T03:30:00.000Z').tz('UTC').isSame('2020-10-12T04:53:43.427Z', 'day') //false
```

Both dates are in UTC, so why is the first query incorrectly saying they're in the same day?

Does `dayjs()` assume a local timezone and `isSame` doesn't (or vice versa)?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.