iamkun / iamkun/dayjs

ArraySupport seems to be missing a ts type

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

Description

**Describe the bug**
Hi~ I want to use dayjs with typescript and arraySupport plugin, it works but there seems to be a problem with typescript. There is a demo: https://codesandbox.io/s/smoosh-pond-tc1rr?file=/src/App.tsx.

In the demo I used `arraySupport` plugin and tried to pass an array parameter. It works well in console, but there is a tip that I can not pass an array parameter to the function.

![image](https://user-images.githubusercontent.com/25398665/111995339-c777dd80-8b53-11eb-89c6-2ea6ad14e2f3.png)

I got the pr https://github.com/iamkun/dayjs/pull/1401, but I don't know why it doesn't work.

How can I do with that?

thx!

**Information**
- Day.js Version v1.10.4
- OS: macOS
- Browser chrome 89

Contributor guide

Open the contributing guide

Research direction

Start with the linked CodeSandbox and the arraySupport plugin's TypeScript declarations, then compare the behavior with pull request #1401. The work is done when passing an array parameter works at runtime and type-checks without an error in the demonstrated usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.