iamkun / iamkun/dayjs

Wrong return type of Duration seconds function

Open
#1,464 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**
`seconds` method of Duration object specifies return type as number, but instead I get a string.
Type is specified here https://github.com/iamkun/dayjs/blob/dev/types/plugin/duration.d.ts#L38

`typeof dayjs.duration("PT30S").seconds()` gives `string`
**Expected behavior**
I expect it to either be a number or if the method should return a string, the type would be string as well.

**Information**
- Day.js Version - 1.10.4

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.