const parkingElems = document.getElementsByClassName("parkingwrapper") const dateBoundary = new Date('2021-05-17') const nowLocal = new Date() if (officeParking.includes(values.office) && hasParkingId && (dateBoundary < nowLocal || values.access_week === "Next week")) { for(let elem of parkingElems) { elem.style.display = "inline-flex" } } else { for(let elem of parkingElems) { elem.style.display = "none" elem.querySelector("input").checked = false } }