Skip to content

fix(types): add QUnitType to isSameOrBefore and isSameOrAfter unit param - #3376

Open
Ganesh1729-ui wants to merge 1 commit into
iamkun:devfrom
Ganesh1729-ui:fix/isSameOrBefore-quarter-type
Open

Ganesh1729-ui wants to merge 1 commit into
iamkun:devfrom
Ganesh1729-ui:fix/isSameOrBefore-quarter-type

Conversation

@Ganesh1729-ui

Copy link
Copy Markdown

When you call isSameOrBefore or isSameOrAfter with 'quarter' as the unit, TypeScript gives an error because the type only accepts OpUnitType. But 'quarter' is in QUnitType, not OpUnitType.

The fix is to change the unit param type from OpUnitType to QUnitType | OpUnitType in both plugin type files. This matches how diff() is typed in the main index.d.ts.

The existing 20 tests pass with no changes.

Closes #3192.

This branch has not been deployed

No deployments
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 this pull request may close these issues.

TypeScript errors occur when using isSameOrBefore and isSameOrAfter

2 participants