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

Type error with the quarterOfYear plugin #2166

Open
amaljosea opened this issue Dec 19, 2022 · 1 comment · May be fixed by #2167
Open

Type error with the quarterOfYear plugin #2166

amaljosea opened this issue Dec 19, 2022 · 1 comment · May be fixed by #2167

Comments

@amaljosea
Copy link

amaljosea commented Dec 19, 2022

Describe the bug

quarter and week not supported in when using quarterOfYear plugin

See error from example https://codesandbox.io/s/dayjs-types-forked-v4t64b?file=/src/index.ts

No overload matches this call.
  Overload 1 of 2, '(value: number, unit: QUnitType): Dayjs', gave the following error.
    Argument of type 'TimeIntervalType' is not assignable to parameter of type 'QUnitType'.
      Type '"week"' is not assignable to type 'QUnitType'.
  Overload 2 of 2, '(value: number, unit?: ManipulateType | undefined): Dayjs', gave the following error.
    Argument of type 'TimeIntervalType' is not assignable to parameter of type 'ManipulateType | undefined'.
      Type '"quarter"' is not assignable to type 'ManipulateType | undefined'.ts(2769)

Expected behavior
No typescript errors are expected, but now there are errors.

Information

  • Day.js Version: 1.11.7
  • OS: Mac
  • Browser: Chrome
  • Time zone: GMT+0530 (India Standard Time)
@amaljosea
Copy link
Author

Looks like similar to #1865

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

Successfully merging a pull request may close this issue.

1 participant