Если вы не возражаете, внести изменения в Clockpicker (я должен был сделать это для IE), добавляет неофициальный вариант, как "roundmodfive" в бутстраповской-clockpicker .js:
1. изменить это
// Hours and minutes are selected
ClockPicker.prototype.done = function() {
raiseCallback(this.options.beforeDone);
this.hide();
var last = this.input.prop('value'),
value = leadingZero(this.hours) + ':' + leadingZero(this.minutes);
if (this.options.twelvehour) {
value = value + this.amOrPm;
}
...
2. По й is
// Hours and minutes are selected
ClockPicker.prototype.done = function() {
raiseCallback(this.options.beforeDone);
this.hide();
var last = this.input.prop('value');
//Unofficial option added
/*
Just an explain:
I like rounding. Thus, for example 43min => 45 and 42min => 40.
The minutes are base 60, so you have to make modulus 60.
*/
if (this.options.roundmodfive) {
this.minutes = (Math.round(parseInt(this.minutes)/5)) * 5 % 60;
}
var value = leadingZero(this.hours) + ':' + leadingZero(this.minutes);
if (this.options.twelvehour) {
value = value + this.amOrPm;
}
...
Я не понимаю проблему, по умолчанию вы можете установить только время с делимым на 5 минут. http://i.stack.imgur.com/Tea6d.png –
Нет, это не по умолчанию, вы можете выбрать минуты, не делящиеся на 5. – user3569123