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 93 forks source link

timepicker breaks if range crosses meridiem from PM to AM #94

Open designosis opened 7 years ago

designosis commented 7 years ago

See jsfidde here.

The following ...

    $('#time2').timepicker({
        zindex: 9999,
        timeFormat: 'h:mm p',
        interval: 15,
        startTime:   '11pm',
        minTime:     '11pm',
        maxTime:     '1:00am',
        defaultTime:    '11:30pm',
        dynamic: false,
        dropdown: true,
        scrollbar: true
    });

... doesn't work. If you switch am with pm, not crossing the 24:00 hour mark, it does work.

ptrin commented 3 years ago

I have this exact issue too. I want to make the minTime and maxTime dynamic based on the user's timezone but this can result in a range like 12:30pm - 3am, triggering this problem.

ptrin commented 3 years ago

Despite my commit message above, my change only fixes this issue for the case where the dropdown is not used (we don't use it).