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: missing types of datepicker #16334

Merged

Conversation

riddhybansal
Copy link
Contributor

Closes #16084

Some of the typings for the DatePicker component that are passed directly to flatpickr are incomplete (missing some of the possible types), meaning that Typescript can add a warning/error to a provided prop even though the value is valid to flatpickr.

Changelog

New

  • {{new thing}}

Changed

  • Types of enable, disable, minDate, maxDate

Testing / Reviewing

Try assigning value of type date to enable, disable , minDate and maxDate (eg : enable={[(date) => ![0, 6].includes(date.getDay())]} , minDate={new Date()}, disable={[
{
from: new Date().setDate(new Date().getDate() - 3),
to: new Date().setDate(new Date().getDate() + 3),
},
]} )

Typescript compiler should not give error.

@riddhybansal riddhybansal requested a review from a team as a code owner May 6, 2024 17:27
Copy link

netlify bot commented May 6, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 30a3b10
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/6639bb09e8637400081c85a5
😎 Deploy Preview https://deploy-preview-16334--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@2nikhiltom 2nikhiltom self-requested a review May 7, 2024 05:23
@riddhybansal riddhybansal requested a review from a team as a code owner May 7, 2024 05:24
@riddhybansal riddhybansal requested a review from guidari May 7, 2024 05:24
Copy link
Contributor

@2nikhiltom 2nikhiltom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@tay1orjones tay1orjones added this pull request to the merge queue May 7, 2024
@tay1orjones tay1orjones removed the request for review from tw15egan May 7, 2024 17:14
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 7, 2024
@guidari guidari added this pull request to the merge queue May 7, 2024
Merged via the queue into carbon-design-system:main with commit dbb24d3 May 7, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Typescript types incomplete for DatePicker component
4 participants