Incorrect dayjs.tz() type
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
`dayjs.tz()` should be able to be called without any arguments to get current time based on the default timezone. Currently the type requires first argument
currently we have to use `dayjs.tz(undefined)` to satisfy the type
**Expected behavior**
`dayjs.tz()` should work with TypeScript
**Information**
- Day.js Version: v1.11.1
- OS: macOS
- Browser: Chrome 100.0.4896.127
- Time zone: GMT+0800
Contributor guide
Research direction
The issue identifies dayjs.tz() as the affected API entry point; start by locating its TypeScript declaration and checking how the no-argument call is typed. Done means dayjs.tz() type-checks in TypeScript while the existing undefined form remains valid. No file or test path is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100