date_time_picker icon indicating copy to clipboard operation
date_time_picker copied to clipboard

Add selectableMinutePredicate and selectableHourPredicate: Allow hours and minutes picker to be finer grained

Open gbloggs opened this issue 3 years ago • 0 comments

This post on SO shows a time picker very similar to the time picker in this flutter library:

https://stackoverflow.com/a/65441149/1279002

The nice feature of the SO post is being able to select the time in blocks, say only 5 mins, or 10, or 15 or 20... The time picker in the SO nicely greys out the minute options that are not available.

This date time picker already has a selectableDayPredicate. It would be nice to be able to have a predicate for hours and minutes.

Use case:

UPDATE After further consideration the use case should also involve the date picker:

A hair salon has different opening hours depending on the day. Most days they are opened between 09:00 and 17:00. They have a late night on a Thursday 09:00 - 20:00 and finish early on a Saturday, 08:30 to 16:00.

To allow a booking slot to be made, the picker should only offer the hours dependant on the day that was selected in the date picker, so say if the date selected was a Thursday, the hours avaliable would be 09:00 - 20:00. Time slots are every 20 minutes, so the time picker should only offer, 00, 20 and 40 minutes to be selected.

gbloggs avatar Jul 22 '21 20:07 gbloggs