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

fix Calendar value typings #3517

Closed
wants to merge 1 commit into from
Closed

Conversation

jpeletier
Copy link
Contributor

@jpeletier jpeletier commented Jan 11, 2023

Add missing typings for open date ranges. These are necessary when you are using the calendar to select a date range. One end of the range may not be chosen yet. This adds the typing for a fixed size array of size 2.

Optionally, to simplify the code, we can define it separately (this is how I have it in my code):

type OpenDateRange = [Date | null | undefined, Date | null | undefined];
type CalendarValueType = string | Date | string[] | Date[] | OpenDateRange | undefined;

Alternatively, OpenDateRange could be defined as (Date | null | undefined )[]

Fixes #3521

###Feature Requests
Due to company policy, we are unable to accept feature request PRs with significant changes as such cases has to be implemented by our team following our own processes.

Add missing typings for open date ranges. These are necessary when you are using the calendar to select a date range. One end of the range may not be chosen yet. This adds the typing for a fixed size array of size 2.

Optionally, to simplify the code, we can define it separately (this is how I have it in my code):
```typescript
type OpenDateRange = [Date | null | undefined, Date | null | undefined];
type CalendarValueType = string | Date | string[] | Date[] | OpenDateRange | undefined;
```
Alternatively, `OpenDateRange` could be defined as `(Date | null | undefined )[]`
@tugcekucukoglu
Copy link
Member

The team has decided not to use type. Please check #3696

In this circumstances closing the PR.

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.

Calendar: Invalid typings for date ranges
2 participants