timepicker
timepicker copied to clipboard
timepicker breaks if range crosses meridiem from PM to AM
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.
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.
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).