wvega / timepicker

A jQuery plugin to enhance standard form input fields helping users to select (or type) times
http://timepicker.co
GNU General Public License v2.0
216 stars 92 forks source link

Range #72

Open ghost opened 8 years ago

ghost commented 8 years ago

How to make value in next timepicker input => previous timepicker?

wvega commented 8 years ago

Hi @shadyonline, this demo restricts the selected entry time in the next time picker to be greater than the value selected in the previous one: http://jsfiddle.net/wvega/A9cE6/embedded/.

This is the part of the code I think you are interested in:

$('#tp1')
    .timepicker('setTime', '11:40a')
    .timepicker('option', 'change', function(time) {
        // update startTime option in timepicker-2
        $('#tp2').timepicker('option', 'minTime', time);
    });