mui-x icon indicating copy to clipboard operation
mui-x copied to clipboard

[TimePicker] Support validating `disablePast` and `disableFuture`

Open LukasTy opened this issue 3 years ago • 4 comments

Fixes #4868

Add disablePast and disableFuture prop handling to timeValidation and clock picker disabled time calculation.

LukasTy avatar Sep 20 '22 13:09 LukasTy

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 516.9 886.6 766.3 705.02 157.451
Sort 100k rows ms 610.9 1,388.2 1,388.2 1,102.36 285.642
Select 100k rows ms 148.2 308.8 231 229.44 55.742
Deselect 100k rows ms 177.1 357.1 184.7 218.86 69.387

Generated by :no_entry_sign: dangerJS against 44eb781b15bb3c2c04c4413830f42fc7df27b7f9

mui-bot avatar Sep 20 '22 13:09 mui-bot

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

github-actions[bot] avatar Sep 21 '22 08:09 github-actions[bot]

@flaviendelangle do you have an option on this PR?

Otherwise, I will merge after doing

-If `true` future selection is disabled.
+If `true` disable values after the current time.

-If `true` past selection is disabled.
+If `true` disable values before the current time

alexfauquette avatar Sep 21 '22 10:09 alexfauquette

I'll try to review it today or tomorrow, if it is not blocking you for something else :+1:

flaviendelangle avatar Sep 21 '22 10:09 flaviendelangle

+If `true` disable values after the current time.

I agree with this diff :+1:

flaviendelangle avatar Sep 22 '22 10:09 flaviendelangle

I added the default value to disableFuture and disablePast for time pickers and reworked the typing of the validation quite a bit because it was becoming very hard to play with.

flaviendelangle avatar Sep 22 '22 11:09 flaviendelangle

I will merge it after today's release

flaviendelangle avatar Sep 23 '22 10:09 flaviendelangle