Does TimePicker not allow "24:00"?

I need to create a “from ... to” time selection and create 2 TimePicker components for it. Since the database behind already exists over the years and uses the 24 hour format, in my code I install

tpOpenFrom.setIs24HourView(true);
tpOpenTo.setIs24HourView(true);

Now my problem is that it seems that “24:00” cannot be selected as the value “to:”, since after “23” (: 00) the component switches “back” to “00”, (: 00), which makes it impossible to find out if the user forgot to make the actual choice, for example, if “09:00” was entered as “from” and “00:00” as “before” time. Or, if the choice was made “00:00” to “00:00”: did the user forget to enter something or does he intend to define “open around the clock”?

In 24 hour mode, TimePicker should really allow you to enter 24:00. The 24-hour clock system in ISO 8601 defines midnight as a special case, which can be called both “00:00” and “24:00”, so TimePicker should set the clock to 24 and automatically block minutes to 00.

Does anyone have an idea how to achieve this using TimePicker?

+5
source share
1 answer

I had the same problems with bootprap timepicker, but it is not difficult to implement. I am using timepicker Joris de Wit ( http://jdewit.imtqy.com/bootstrap-timepicker/ ).

find "24" and replace all occurrences with "25", then find "23" in the bootstrap-timepicker.js file and replace them with "24".

, , 24:01,.., 24:59, . 24:00, 24 , 133, getTime.

( ):

if (this.hour == 24 && this.minute != 0) {
  this.setTime('00:' + this.minute);
  return '00:' + this.minute;
}

24: XX 00: XX.

+2

All Articles