BUG: Time Picker End time not auto changing properly after 12:00PM Start
-
Chrome, OS X MAC
User chooses a start time and the end time should auto select 15 min later (great feature)
Works for times with start time before 11:45am
HOWEVER if 12:00pm or beyond is selected, the end time will be auto selected to 12:00pm
I’m not quite understanding how your function works, but your bug is probably in this function:
thank you
admin/scripts/admin.js
var $form = $('#business-hours'); jQuery(document).on("change", ".bup_select_start", function(e) { //$('.bup_select_start').on('change', function () { var $row = $(this).parent(), $end_select = $('.bup_select_end', $row), $start_select = $(this); if ($start_select.val()) { $end_select.show(); $('span', $row).show(); var start_time = $start_select.val(); $('span > option', $end_select).each(function () { $(this).unwrap(); }); // Hides end time options with value less than in the start time $('option', $end_select).each(function () { if ($(this).val() <= start_time) { $(this).wrap("<span>").parent().hide(); } }); if (start_time >= $end_select.val()) { $('option:visible:first', $end_select).attr('selected', true); } } else { // OFF $end_select.hide(); $('span', $row).hide(); } }).each(function () { var $row = $(this).parent(), $end_select = $('.bup_select_end', $row); $(this).data('default_value', $(this).val()); $end_select.data('default_value', $end_select.val()); // Hides end select for "OFF" days if (!$(this).val()) { $end_select.hide(); $('span', $row).hide(); } }).trigger('change');
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘BUG: Time Picker End time not auto changing properly after 12:00PM Start’ is closed to new replies.