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

disabledHours in TimePicker #8776

Closed
mb8z opened this issue Dec 28, 2017 · 3 comments
Closed

disabledHours in TimePicker #8776

mb8z opened this issue Dec 28, 2017 · 3 comments

Comments

@mb8z
Copy link

mb8z commented Dec 28, 2017

Version

3.0.3

Environment

not important

Reproduction link

http://not.important

Steps to reproduce

The TimePicker component has an option to disable the hours using disabledHours property.
For pure example, let's say that I want to disable even hours (like 2, 4, 6 etc.). How am I suppose to do that? I can't compare the time.

Don't really know if I explained it clearly. If not, then please go ahead and try my example above (with even hours being disabled) - you will see what I mean.

What is expected?

The function should have hour attribute so I can compare it and return a specific boolean.

What is actually happening?

Nothing to compare it with. The function doesn't have any argument.

@dengfuping dengfuping self-assigned this Dec 29, 2017
@dengfuping
Copy link
Contributor

@Ancinek There is no need to pass params to disabledHours function. You just need to return an array containing the hours you want to disable.

disabledHours={() => [1, 2, 3]}

image

@mb8z
Copy link
Author

mb8z commented Dec 29, 2017

Thank you for the answer! It would be good to include this part in the docs!
Have a nice ending of 2017!

@yutingzhao1991
Copy link
Contributor

@Ancinek welcome to make a pr help us improve docs.

Have a nice ending of 2017!

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

No branches or pull requests

3 participants