1
I’m having trouble implementing the timepicker in my system.
The user must select a time in a dropdownlist
and this time will be used to be the minTime of timepicker. For example, the user selects 01:00:00
and this will be the minTime and by default the maxTime would be 5 hours after the minTime.
At first it works very well, but if the user selects another time, for example 14:00:00
, the new durations are not timepicker. I have already used the example of the manufacturer but it did not work, or I did not understand what should be done.
Follows 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,
});
}