question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

shouldDisableDate does not work when using "Year picker"

See original GitHub issue

When using DatePicker to select an year shouldDisableDate does not work.

<DatePicker
    views={['year']}
    shouldDisableDate={day => true}

still displays all years from 1900 to 2100

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
dmtrKovalenkocommented, Jun 15, 2020

I think it will only make it easier to lose that you will disable a whole year by disabling just the first day. Moreover, it will introduce a weird and easy-to-miss breaking change.

0reactions
JordanWinslowcommented, Oct 7, 2020

@dmtrKovalenko I’m using @material-ui/pickers 3.2.10 and I do not see shouldDisableYear or shouldDisableMonth in my DatePickerProps definition. Am I doing something wrong or perhaps have the TS definitions not been updated?

Read more comments on GitHub >

github_iconTop Results From Across the Web

shouldDisableDate does not work when using "Year picker"
When using DatePicker to select an year shouldDisableDate does not work. true} still displays all years from 1900 to 2100.
Read more >
MUI DatePicker's shouldDisableDate prop leading to error
But when I press the datepicker it is leading to this error. The minDate is working perfectly fine using the fromDate state variable....
Read more >
Material ui disbale specific dates! - CodeProject
I want to disable specific dates in the date picker using the props shouldDisableDates, but as it accepts only functions I have written...
Read more >
StaticDateTimePicker API - MUI X
Name Type Default onChange * func renderInput * func acceptRegex RegExp /\dap/gi
Read more >
React 17 Material-UI Datepicker and Timepicker Example ...
There are a number of UI components provided by Material UI package modules. To use a component we first import it in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found