Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Typescript] dayOfYear definition #802

Closed
Toub opened this issue Feb 20, 2020 · 1 comment
Closed

[Typescript] dayOfYear definition #802

Toub opened this issue Feb 20, 2020 · 1 comment

Comments

@Toub
Copy link
Contributor

Toub commented Feb 20, 2020

Describe the bug

Typescript provides only one dayOfYear method without arg:

declare module 'dayjs' {
  interface Dayjs {
    dayOfYear(): number
  }
}

https://github.com/iamkun/dayjs/blob/v1.8.20/types/plugin/dayOfYear.d.ts

Expected behavior

A second method is described in the documentation, it should be available in types too: https://github.com/iamkun/dayjs/blob/v1.8.20/docs/en/Plugin.md

// first method:  dayOfYear(): number
dayjs('2010-01-01').dayOfYear() // 1

// second method:  dayOfYear(year: number): Date
dayjs('2010-01-01').dayOfYear(365) // 2010-12-31

Not sure what is the best way to describe it with types, but this should help:

Information

  • Day.js Version v1.8.20
  • OS: any
  • Browser any
  • Time zone: any
@iamkun
Copy link
Owner

iamkun commented Feb 21, 2020

Thanks.

Fixed in #799.

And will release soon.

@iamkun iamkun closed this as completed Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants