react-native-paper-dates icon indicating copy to clipboard operation
react-native-paper-dates copied to clipboard

Allow validRange for Time Picker

Open jonnyasmar opened this issue 4 years ago • 6 comments
trafficstars

Subject really says it all. There doesn't seem to be a way to define a validRange for the Time Picker.

jonnyasmar avatar May 08 '21 17:05 jonnyasmar

What is your use-case (why you want this feature?)

RichardLindhout avatar May 08 '21 19:05 RichardLindhout

Sorry, I should've elaborated on that to begin with.

My specific use-case is that I'm creating a form with a "deadline" field. That deadline has to be some point in the future. While I could, of course, employ validations to check this, I would prefer to be able to restrict the time picker from being able to select a time in the past if the date picker is set to "today".

I could also imagine other scenarios such as a time picker that must be within "business hours". On May 8, 2021, 15:42 -0400, Richard Lindhout @.***>, wrote:

What is your use-case (why you want this feature?) — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

jonnyasmar avatar May 08 '21 20:05 jonnyasmar

@RichardLindhout , just wanted to comment that I would love this feature too!

My use-case is setting an appointment. Obviously, it should be impossible to set an appointment in the past. For now, I am using errors messages to communicate to the user that the start and end times cannot be set in the past. However, it would be awesome to simply restrict the user to a certain time frame, giving them less options to choose from.

justinyum98 avatar Jul 06 '21 23:07 justinyum98

PR for this appreciated!

RichardLindhout avatar Nov 13 '21 14:11 RichardLindhout

Sorry! I've been swamped with a new job, new home, and new baby. I most likely won't have time to contribute to this until at least Q1'22.

I'd be happy to help review/test in the meantime if someone else can contribute before then. On Nov 13, 2021, 09:01 -0500, Richard Lindhout @.***>, wrote:

PR for this appreciated! — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

jonnyasmar avatar Nov 13 '21 15:11 jonnyasmar

Hi, I also was looking for doing something like that (I mean, place only business hours 8-12pm, 1-5pm) but I can't find the way of implementing this.

luzpm1102 avatar Jul 05 '22 15:07 luzpm1102