Fix bug which caused new empty worked shift when editing time sheet

This commit is contained in:
Lance Edgar 2017-08-08 17:59:57 -05:00
parent 158755377b
commit b28dc0702e

View file

@ -183,6 +183,9 @@ function update_timetable() {
var end_time = $(this).children('input[name|="edit_end_time"]').val();
var shift = editing_day.children('.shift[data-uuid="' + uuid + '"]');
if (! shift.length) {
if (! (start_time || end_time)) {
return;
}
shift = $('<p class="shift" data-uuid="' + uuid + '"><span></span></p>');
shift.append($('<input type="hidden" name="employee_uuid-' + uuid + '" value="'
+ editing_day.parents('tr:first').data('employee-uuid') + '" />'));