element-plus [Feature Request] [Enhancement] [time-picker] Time Picker (range based picker) - Minimum time gap

polhcujo  于 2022-11-05  发布在  其他
关注(0)|答案(2)|浏览(212)

Feature type:Enhancement

Details

  • Enhanced compone nt name: time-picker

Description

The time picker currently doesn't allow the user to pick an end time before the start time. This allows the user to pick an equal start and end time. However, I have a situation where I need a minimum time gap of 30min, so the end time can be no sooner than 30m after the start time.

E.g. If a user selects a start time 12:34 (HH:mm) and sets theminimum time gapto 1200s (20m) then the minimum selectable end time should be 12:54.

Additional comments

It doesn't look like this is possible to accomplish without extending the time-picker element and I can see many situations were this would be a useful feature.

zphenhs4

zphenhs41#

Maybe we can add a series of step parameters to achieve it.

cidc1ykv

cidc1ykv2#

Maybe we can add a series of step parameters to achieve it.

I'm not sure if I get what you mean by step parameters. Are you saying that setting a step size of 30m means that you can only select times on the hour and half hour? This wouldn't necessarily mean that you can't select an end time equal to the start, plus the user is now limited with time options due to the step size. I think a step size feature would be a nice addition but a min start/end time gap would still need to be a separate feature.

Another example to be clear on what I'm proposing:

Setting a minimum start/end time "gap" of 45m would make the following time selections possible:

  • 4:14 - 4:59 (gap 45m == 45m) ✅
  • 18:21 - 19:17 (gap 56m > 45m)✅

but the following wouldnotbe possible:

  • 4:15 - 4:20 (gap 5m < 45m) ❌
  • 18:21 - 18:59 (gap 38m < 45m) ❌

相关问题