% /* /flyer - the link you send someone so they can grab the poster and pass it on. Same next-occurrence rule as the home page so the date on this page is never stale. */ const TZ = site.timezone || "America/New_York"; const V = site.venue; const now = new Date(); const todayISO = new Intl.DateTimeFormat("en-CA", { timeZone: TZ, year: "numeric", month: "2-digit", day: "2-digit", }).format(now); const hourET = Number( new Intl.DateTimeFormat("en-US", { timeZone: TZ, hour: "2-digit", hourCycle: "h23" }).format(now) ) % 24; const toDate = (iso) => { const [y, m, d] = iso.split("-").map(Number); return new Date(Date.UTC(y, m - 1, d)); }; const isoOf = (dt) => dt.toISOString().slice(0, 10); let next = toDate(todayISO); const first = toDate(site.firstEvent); if (next < first) next = first; while (next.getUTCDay() !== site.weekday) next.setUTCDate(next.getUTCDate() + 1); if (isoOf(next) === todayISO && hourET >= (site.endHour24 || 21)) next.setUTCDate(next.getUTCDate() + 7); (site.cancelled || []).length && (function () { while ((site.cancelled || []).includes(isoOf(next))) next.setUTCDate(next.getUTCDate() + 7); })(); const nextLong = new Intl.DateTimeFormat("en-US", { timeZone: "UTC", weekday: "long", month: "long", day: "numeric", }).format(next); const weekdayName = new Intl.DateTimeFormat("en-US", { timeZone: "UTC", weekday: "long" }).format(next); const pdf = "/assets/founders-break-flyer.pdf"; const shareText = `${site.name}: a free pool social for people building things in ${V.city}. Every ${weekdayName}, ${site.startTime} to ${site.endTime} at ${V.name}, ${V.street}. 18+, no cover.`; %>