I'm having a hard time implementing timepicker on my system.
Theusermustselectatimeinadropdownlist
andthistimewillbeusedtobetheminTimeof timepicker . For example, the user selects 01:00:00
and this will be minTime and by default maxTime would be 5 hours after minTime . >
At first it works great, but if the user selects another time, for example 14:00:00
, the new durations are not by the timepicker . I already used the manufacturer's example but it did not work, or I did not quite understand what should be done.
Follow the code
.on("change", "#listahorDisp", function () {
var horaMin = moment($('#listahorDisp :selected').text(), 'HHmmss');
var horaMax = moment(horaMin).add(5, 'hours').format('hh:mm:ss');
retornaDuracaoAtendimento(horaMin._i,horaMax);
})
function retornaDuracaoAtendimento(horaMin, horaMax) {
$('#durationExample').timepicker(
{
'timeFormat': 'H:i:s',
'minTime': horaMin,
'maxTime' : horaMax,
'showDuration': true,
});
}