Element ui time range selector, how to set the maximum time difference

Element ui time range selector, how to set the maximum time gap to 2 hours. For example, if I choose the start time at 18:00 and the end time at 24:00, I automatically change the 4 start time to 22:00. I have implemented this function on my own before, but now I am maintaining it on the original project. Is there any quick way for element ui to implement


  1. use TimePicker components
  2. add watch to adjust minTime and maxTime according to the bound start and end values, or the change event provided by the component to dynamically adjust the value of start or end. Should be able to meet the demand

document

Menu