баг-фикс 30/34
This commit is contained in:
@@ -62,8 +62,8 @@ export async function initTimeSlotsSettings() {
|
||||
form?.addEventListener('submit', saveSlot);
|
||||
resetButton?.addEventListener('click', resetForm);
|
||||
refreshButton?.addEventListener('click', loadAll);
|
||||
startInput?.addEventListener('change', fillDurationIfEmpty);
|
||||
endInput?.addEventListener('change', fillDurationIfEmpty);
|
||||
startInput?.addEventListener('change', calculateDuration);
|
||||
endInput?.addEventListener('change', calculateDuration);
|
||||
tbody?.addEventListener('click', handleSlotTableClick);
|
||||
|
||||
await loadAll();
|
||||
@@ -206,8 +206,7 @@ export async function initTimeSlotsSettings() {
|
||||
orderNumber: Number(orderInput.value),
|
||||
scopeId: activeScopeId,
|
||||
startTime: startInput.value,
|
||||
endTime: endInput.value,
|
||||
durationMinutes: durationInput.value ? Number(durationInput.value) : null
|
||||
endTime: endInput.value
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -272,8 +271,9 @@ export async function initTimeSlotsSettings() {
|
||||
}
|
||||
}
|
||||
|
||||
function fillDurationIfEmpty() {
|
||||
if (durationInput.value || !startInput.value || !endInput.value || startInput.value >= endInput.value) return;
|
||||
function calculateDuration() {
|
||||
durationInput.value = '';
|
||||
if (!startInput.value || !endInput.value || startInput.value >= endInput.value) return;
|
||||
const [startHour, startMinute] = startInput.value.split(':').map(Number);
|
||||
const [endHour, endMinute] = endInput.value.split(':').map(Number);
|
||||
durationInput.value = String((endHour * 60 + endMinute) - (startHour * 60 + startMinute));
|
||||
|
||||
Reference in New Issue
Block a user