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

[pickers] Refactor shouldDisableTime #7299

Merged
merged 14 commits into from
Jan 10, 2023

Conversation

LukasTy
Copy link
Member

@LukasTy LukasTy commented Dec 22, 2022

Improves on #7167

  • Rename existing shouldDisableTime to shouldDisableClock and deprecate it
  • Add shouldDisableTime working with complete date object, instead of only number (hours, minutes or seconds) from view

Playground to test the change.

Changelog

Breaking changes

shouldDisableTime prop signature has been changed. Either rename the prop usage to shouldDisableClock or refactor usage.

 <DateTimePicker
-  shouldDisableTime={(timeValue, view) => view === 'hours' && timeValue < 12}
+  shouldDisableClock={(timeValue, view) => view === 'hours' && timeValue < 12}
 />

 <DateTimePicker
-  shouldDisableTime={(timeValue, view) => view === 'hours' && timeValue < 12}
+  shouldDisableTime={(time, view) => view === 'hours' && value.hour() < 12}
 />

@LukasTy LukasTy added component: pickers This is the name of the generic UI component, not the React module! dx Related to developers' experience breaking change v6.x labels Dec 22, 2022
@mui-bot
Copy link

mui-bot commented Dec 22, 2022

Messages
📖 Netlify deploy preview: https://deploy-preview-7299--material-ui-x.netlify.app/

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 672.1 1,098.6 672.1 870.38 160.714
Sort 100k rows ms 717.4 1,239.7 1,239.7 1,067.24 196.992
Select 100k rows ms 245.5 410.6 318 326.18 65.196
Deselect 100k rows ms 183 303.4 195.2 217.52 44.27

Generated by 🚫 dangerJS against ab30313

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 4, 2023
@github-actions
Copy link

github-actions bot commented Jan 4, 2023

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@LukasTy LukasTy marked this pull request as ready for review January 10, 2023 09:31
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label Jan 10, 2023
Copy link
Member

@flaviendelangle flaviendelangle left a comment

Choose a reason for hiding this comment

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

Works great 🥳
Beta is coming !

@LukasTy LukasTy merged commit 688b7e3 into mui:next Jan 10, 2023
@LukasTy LukasTy deleted the refactor-should-disable-time branch January 10, 2023 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: pickers This is the name of the generic UI component, not the React module! dx Related to developers' experience v6.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants