Event Calendar

Adventist Youth Missions Summit
conference
View Event
Date(s):
start
-
end
","end":"2025-11-09T19:00:00.000Z","location":"Ozark Outpost Center","registrationLink":"https://tally.so/r/waML79","slug":{"_type":"slug","current":"ayms"},"start":"2025-11-06T21:00:00.000Z","title":"Adventist Youth Missions Summit","type":"conference","workshopAvailability":false}] var calendarEl = document.getElementById("calendar"); var popup = document.getElementById("event-popup"); var calendar = new FullCalendar.Calendar(calendarEl, { initialView: "dayGridMonth", events: data, eventMouseEnter: function (info) { const { title, extendedProps, start, end, speaker } = info.event; popup.style.display = "flex"; popup.querySelector("#popup-title").innerText = title; popup.querySelector("#popup-type").innerText = extendedProps.type || ""; popup.querySelector('[box="start-date"]').innerText = formatDate(start); popup.querySelector('[box="end-date"]').innerText = formatDate(end); // returns "" if null popup.querySelector('[box="speaker"]').innerText = speaker || "TBA"; popup.querySelector("#popup-image").srcset = extendedProps.bgImageURL; // Position the popup near the mouse info.el.addEventListener("mousemove", function (e) { popup.style.left = e.pageX + 10 + "px"; popup.style.top = e.pageY + 10 + "px"; }); }, eventMouseLeave: function () { popup.style.display = "none"; }, }); calendar.render(); }); function formatDate(dateString) { if (!dateString) return ""; // handle missing end date const date = new Date(dateString); const options = { month: "long", day: "numeric" }; const formatted = date.toLocaleDateString("en-US", options); // Add suffix (st, nd, rd, th) const day = date.getDate(); const suffix = day % 10 === 1 && day !== 11 ? "st" : day % 10 === 2 && day !== 12 ? "nd" : day % 10 === 3 && day !== 13 ? "rd" : "th"; return formatted.replace(/\d+/, day + suffix); // e.g., June 15th }