isBefore() produces strange result when provided any one or both of the parameter as undefined.
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
When we pass `undefined` as parameter in `dayjs().isBefore` then it sometimes it returns `true` and sometimes it returns `false`.
This breaks the code someone uses in condition;
*Steps to reproduce*
Step 1: Open chrome or any editor which has dayjs
Step 2: Log this piece of code 7-8 `dayjs(undefined).isBefore(undefined)` you might see different result.
**Screenshots**
A Clear & Better :
**Expected behavior**
Expected behaviour should be like if you pass both as undefined then it should return false every time or a single boolean (true or false any one them) OR it should be handled and thrown appropriate error.
**Information**
- Day.js Version [v1.11.8]
- OS: [macOS]
- Browser [chrome]
- Time zone: [e.g. GTT +5:30 IST (Asia/ Kolkata Time Zone)]
Contributor guide
Assessment
This issue has not been assessed yet.