material-ui-pickers icon indicating copy to clipboard operation
material-ui-pickers copied to clipboard

How to properly use DateTimePicker's shouldDisableDate?

Open JMV2112 opened this issue 8 years ago • 4 comments

Environment

Tech Version
material-ui-pickers 1.0.0-rc.12
material-ui 1.4.0
React 16.4.1
Browser
Platform macOS High Sierra 10.13.4

Steps to reproduce

  1. Follow initial installation steps
  2. Render out a DateTimePicker

Expected behavior

Not sure yet.

Actual behavior

N/A

Per the documentation, I'm unsure of how to fully use the DateTimePicker's shouldDisableDate function. Are you supposed to return a single date, an array of dates or something totally different? Currently, I have an array of future dates that should be disabled and am trying to accomplish it with this property. Any help would be greatly appreciated, thanks!

JMV2112 avatar Jul 27 '18 21:07 JMV2112

It’s firing for each date and expect to return Boolean. It is mentioned in the docs

dmtrKovalenko avatar Jul 29 '18 11:07 dmtrKovalenko

😱😱😱 It is not mentioned. We should fix that

dmtrKovalenko avatar Jul 29 '18 11:07 dmtrKovalenko

Okay, that was another way I that I figured it could work. I appreciate your timely response!

JMV2112 avatar Jul 30 '18 13:07 JMV2112

Fixed https://material-ui-pickers.firebaseapp.com/demo/datepicker

dmtrKovalenko avatar Aug 21 '18 20:08 dmtrKovalenko