iamkun / iamkun/dayjs

Error with `PluginFunc` type for UTC

Open
#2,474 0 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**
We are using DayJs with Deno and are getting the following error:

![image](https://github.com/iamkun/dayjs/assets/44002321/d5f2e571-1032-4360-91ec-ec03edeed25e)

At the moment, we are having to assert the type to avoid this error as follows:
```ts
dayjs.extend(utc as PluginFunc);
```

**Expected behavior**
No type error is given.

**Information**
- Day.js Version [e.g. v1.11.10]
- Deno 1.37.1

Contributor guide

Open the contributing guide

Research direction

Reproduce the Deno usage with the UTC plugin and inspect the PluginFunc type used by dayjs.extend. Confirm the type mismatch and identify the relevant plugin typing entry point; done means dayjs.extend(utc) type-checks without a type assertion.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.