Use querySelectorAll
instead which would return you a list of node. You then have to iterate over then and attach the event handlers.
document.querySelectorAll(".weekdays").forEach(elem => elem.addEventListener("click",
() => {
document.querySelector(".bg-modal").style.display = "flex";
}));