--- import AppLayout from '../../layouts/AppLayout.astro'; import { getPastEvents, getEventRsvpCount } from '../../lib/db'; import { pigmentForId } from '../../lib/format'; const user = Astro.locals.user; const past = getPastEvents(500); function parseUtc(s: string): Date { if (/T.*[Zz]$/.test(s) || /[+-]\d{2}:?\d{2}$/.test(s)) return new Date(s); return new Date(s.replace(' ', 'T') + 'Z'); } function fmt(part: Intl.DateTimeFormatOptions, iso: string): string { return new Intl.DateTimeFormat('en-GB', { ...part, timeZone: 'Europe/Copenhagen' }).format(parseUtc(iso)); } --- The archive. Everything the council has gathered around so far. ← Back to upcoming {past.length === 0 ? ( No past events yet. ) : ( {past.map(ev => { const monthCode = fmt({ month: 'short' }, ev.starts_at).toUpperCase(); const attended = getEventRsvpCount(ev.slug).going; const hasNotes = !!ev.notes_url; const pigA = pigmentForId(ev.id); const pigB = pigmentForId(ev.id + 1); return ( {ev.photo_url ? ( ) : hasNotes ? ( {monthCode} ) : ( {monthCode} )} {ev.title} {fmt({ day: 'numeric', month: 'long', year: 'numeric' }, ev.starts_at)} {ev.location && ` · ${ev.location}`} {attended} attended · {hasNotes ? 'Notes shared' : 'No notes'} ); })} )}
Everything the council has gathered around so far.
No past events yet.
{fmt({ day: 'numeric', month: 'long', year: 'numeric' }, ev.starts_at)} {ev.location && ` · ${ev.location}`}
{attended} attended · {hasNotes ? 'Notes shared' : 'No notes'}