Widget:Hide day field on fuzzy

From The Observatory
<script>
document.addEventListener("DOMContentLoaded", function () {
   const durationSelect = document.querySelector('[name="Event\\[Event duration\\]"]');
   const dayStartField = document.querySelector('[name="Event\\[Day start\\]"]');
   function toggleDayStartField() {
       if (!durationSelect || !dayStartField) return;
       const isFuzzy = durationSelect.value === "Fuzzy date";
       dayStartField.style.display = isFuzzy ? "none" : "";
   }
   // Initial toggle on load
   toggleDayStartField();
   // Toggle on change
   if (durationSelect) {
       durationSelect.addEventListener("change", toggleDayStartField);
   }
});
</script>