// Hours admin page: purely a progressive enhancement over the plain form // POST that actually saves — greys out (and stops submitting) a day's time // fields while its "Open" box is unchecked, so a closed day can't look like // it still has stale hours set. document.querySelectorAll('.hours-day-row').forEach((row) => { const toggle = row.querySelector('input[type="checkbox"]'); const timeFields = row.querySelectorAll('.day-time-field'); function applyState() { timeFields.forEach((field) => { field.disabled = !toggle.checked; }); } toggle.addEventListener('change', applyState); applyState(); });