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

[DateRangePicker] Can't disable dates #5080

Closed
2 tasks done
destegabry opened this issue Jun 1, 2022 · 1 comment · Fixed by #5081
Closed
2 tasks done

[DateRangePicker] Can't disable dates #5080

destegabry opened this issue Jun 1, 2022 · 1 comment · Fixed by #5081
Assignees
Labels
component: DateRangePicker The React component. component: pickers This is the name of the generic UI component, not the React module! plan: Premium Impact at least one Premium user regression A bug, but worse

Comments

@destegabry
Copy link
Contributor

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

Dates are not being disabled using minDate, maxDate or shouldDisableDate props.

Specified dates are enabled, but selecting them will show the error status on the TextField component.

Expected behavior 🤔

Disabled dates are disabled

Steps to reproduce 🕹

Steps:

  1. Head to the DateRangePicker documentation ("Disabling dates" section)
  2. Select a start date
  3. Dates 4 weeks after the selected start date should be disabled, but they aren't
  4. Select a date 5 weeks in the future, the "End" field will display an error state

Context 🔦

I'm trying to disable unavailable dates.

Your environment 🌎

`npx @mui/envinfo`
  System:
    OS: macOS 12.4
  Binaries:
    Node: 18.0.0 - /opt/homebrew/bin/node
    Yarn: 1.22.18 - /opt/homebrew/bin/yarn
    npm: 8.6.0 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: Not Found
    Edge: Not Found
    Firefox: 100.0.2
    Safari: 15.5
  npmPackages:
    @emotion/react: ^11.9.0 => 11.9.0 
    @emotion/styled: ^11.8.1 => 11.8.1 
    @mui/base:  5.0.0-alpha.83 
    @mui/lab: ^5.0.0-alpha.84 => 5.0.0-alpha.84 
    @mui/material: ^5.8.2 => 5.8.2 
    @mui/private-theming:  5.8.0 
    @mui/styled-engine:  5.8.0 
    @mui/system:  5.8.2 
    @mui/types:  7.1.3 
    @mui/utils:  5.8.0 
    @mui/x-data-grid:  5.12.0 
    @mui/x-data-grid-premium: ^5.12.0 => 5.12.0 
    @mui/x-data-grid-pro:  5.12.0 
    @mui/x-date-pickers: ^5.0.0-alpha.5 => 5.0.0-alpha.5 
    @mui/x-date-pickers-pro: ^5.0.0-alpha.5 => 5.0.0-alpha.5 
    @mui/x-license-pro:  5.12.0 
    @types/react: ^18.0.10 => 18.0.10 
    react: ^18.1.0 => 18.1.0 
    react-dom: ^18.1.0 => 18.1.0 
    typescript: ^4.7.2 => 4.7.2 

Order ID 💳 (optional)

44740

@destegabry destegabry added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jun 1, 2022
@flaviendelangle flaviendelangle changed the title Can't disable dates in DateRangePicker (Premium Plan) [DateRangePicker] Can't disable dates Jun 1, 2022
@flaviendelangle flaviendelangle added plan: Premium Impact at least one Premium user component: pickers This is the name of the generic UI component, not the React module! bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jun 1, 2022
@flaviendelangle
Copy link
Member

It seems to work in @mui/x-date-pickers@alpha.4
The bug was introduced in #4814

I will do a fix for the next release, sorry for the inconvenience

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: DateRangePicker The React component. component: pickers This is the name of the generic UI component, not the React module! plan: Premium Impact at least one Premium user regression A bug, but worse
Projects
None yet
2 participants