How to restrict the bootstrap timepicker min-time and max-time?

前端 未结 2 1452
隐瞒了意图╮
隐瞒了意图╮ 2021-01-06 07:27

I am using bootstrap time picker by using bootstrap-timepicker.js and i want to restrict the min-time and max-time of that timepicker .Can anyone please tell me how can i ac

2条回答
  •  萌比男神i
    2021-01-06 07:54

    You can use the following:eg if mindate is at 8.00 and maxdate is at 2300hrs

        minDate: moment({h:8}),
        maxDate: moment({h:23}),
    

    that is...

    $('#time').bootstrapMaterialDatePicker({
        format: 'HH:mm',
        minDate: moment({h:8}),
        maxDate: moment({h:23}),
        clearButton: true,
        date: false
    });
    

提交回复
热议问题