-
Notifications
You must be signed in to change notification settings - Fork 309
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
chore: added minDate and maxDate checks in the datepicker #3060
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0533ce7
fix: added minDate and maxDate in the datepicker
rkkp1023 384472f
chore: address review comments
rkkp1023 4f70d24
chore: fix formating
rkkp1023 5f92ef0
Update src/datepicker/datepicker.component.ts
Akshat55 42526bc
chore: lint fix
Akshat55 c428711
Merge branch 'master' into issue-3059
Akshat55 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @rkkp1023, this was intentionally excluded. At the time of the component creation, it was decided that we weren't going to create explicit wrapper inputs due to the possibility of changes upstream (flatpickr). If we start adding flatpickrOptions as inputs, we will then need to add ALL.
Instead, please pass the maxDate/minDate as part of the flatpickrOptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @Akshat55, Added flatpickerOptions in the storybook
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Akshat55, Q: why the Carbon Angular implementation needs to differ from other implementations - both React and Web Component implementations support minDate/maxData as input properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We tend to follow React implementation for the most part, however there are certain components that we decided to not 100% follow in terms of implementation. Date picker is one of those components.
Date picker is dependent on a third-party library (flatpickr), so it doesn't make sense for us to add all of those inputs/outputs in case there is a change in flatpickr.
In such case, to resolve this, we would need to phase it out via breaking changes, so the reasonable thing to do on our end was allow for a user to pass in a flatpickr options object.
That being said, I definitely think we do need to improve our storybook documentation to better showcase this.