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

feat: Make Calendar disabledDates an array of single dates, use disabledDateRanges for existing functionality #1244

Merged
merged 6 commits into from
Oct 19, 2020

Conversation

skvale
Copy link
Contributor

@skvale skvale commented Oct 16, 2020

Description

Calendar disabledDates were treated as ranges in fundamental-react but documented as single dates that are disabled in our internal component library that consumes this.
Breaking changes

  • remove blockedDates -- These can be replicated with disabledDateRanges
  • treat disabledDates as an array of single dates that are disabled -- previous behavior can be replicated with disabledDateRanges

New additions

  • new prop to Calendar and DatePicker: disabledDateRanges which is an array of two-tuples, everything between the tuples(inclusive) are disabled dates. I went with inclusive because the concept of date ranges is already inclusive
  • the propType for dates was expanded to almost anything that a moment constructor takes, since they should all go through the moment constructor anyways
  • when we use the moment constructor on something that may not be a moment, we need to include the dateFormat or we'll get unexpected dates when a consumer is using 'YYYY.DD.MM' or something

fixes #issueid

@skvale skvale self-assigned this Oct 16, 2020
@netlify
Copy link

netlify bot commented Oct 16, 2020

Deploy preview for fundamental-react ready!

Built with commit c95993f

https://deploy-preview-1244--fundamental-react.netlify.app

Copy link
Member

@prsdthkr prsdthkr left a comment

Choose a reason for hiding this comment

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

QA LGTM 👍

@skvale
Copy link
Contributor Author

skvale commented Oct 19, 2020

@prsdthkr Do you think we should get more eyes from the accessibility team for this change?

@prsdthkr
Copy link
Member

@skvale this seems to be more of an API change than markup changes... so we should be good. This will go down as a breaking change right?

@skvale
Copy link
Contributor Author

skvale commented Oct 19, 2020

yes, this will be a breaking change.

It looks like we could get 17 rc versions into 0.13.1 if we released now and leave this for 0.14.0-rc.0

@skvale skvale merged commit 84b8927 into master Oct 19, 2020
@skvale skvale deleted the feat/datepicker-disable-dates-and-disable-date-range branch October 19, 2020 19:41
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.

3 participants