Max / min attributes in bootstrap-ui timepicker

I want to use the timepicker directive from bootstrap-ui. I need to use the min and max attributes, but I don't understand how to use them.

I tried to use it in the range from 0 to 1440.

<uib-timepicker ng-model="mytime" show-meridian="false" min="840" max="1020"></uib-timepicker>

I also tried to pass different date formats, but this does not solve my problem. For example, I need the user to set the timepicker from 14:00 to 17:00. How can I achieve this effect with these attributes?

Here you can font plunker . Thanks in advance.

+4
source share
1 answer

min max controller:

var d = new Date();
d.setHours( 2 );
d.setMinutes( 0 );
$scope.min = d;

var d2 = new Date();
d2.setHours( 11 );
d2.setMinutes( 0 );
$scope.max = d2;

,

<uib-timepicker ng-model="mytime" min="min" max="max" show-meridian="false"></uib-timepicker>

plunker

+8

Source: https://habr.com/ru/post/1610980/


All Articles