Repository navigation
Add IsTimeAllowed predicate to TimePicker and Clock - #4116
Open
MORTEM3845 wants to merge 1 commit into
Open
MORTEM3845 wants to merge 1 commit into
MORTEM3845 wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a single optional
IsTimeAllowedproperty (Predicate<DateTime>?) toTimePickerandClock, allowing applications to decide which minute slots can be selected. A null rule preserves unrestricted selection.For example, appointments can be available from 06:00 through 19:00, every 10 minutes, with a 13:00-14:00 lunch break, using only this property:
The native clock keeps its existing layout and disables unavailable values. The same rule applies to dragging, typed input, and programmatic selection. Programmatic values are coerced to the nearest allowed minute on the same day; invalid typed input follows the existing invalid-text behavior.
Rules receive the selected date and time with seconds cleared: availability is defined per minute, while
WithSecondscontinues to control seconds selection. If captured application data changes, callRefreshTimeAvailability()to reevaluate the current selection and clock buttons. If no minute is allowed,TimePicker.SelectedTimebecomes null and clock choices are disabled.The existing
MinuteSelectionStepbehavior is preserved. No additional range or increment properties are introduced.Addresses #3733.
Validation: