Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/components/sections/OpenSpacesCalendar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ export interface Props {
}

const {
calendarId = "c_b87075b29cf4a9dd4da3fe724fcba92a4b406aa3f91cb7e7ce50fede43215b17@group.calendar.google.com",
timeMin = "20260713",
timeMax = "20260719",
rooms = ["S4(1,2,3)", "S4(4)", "S4(5)"],
} = Astro.props;

Expand All @@ -35,6 +32,7 @@ function fmtDateLabel(isoDate: string): string {
} catch { return isoDate; }
}


// ── Main data fetch ──

const allEvents = await fetchOpenSpacesEvents();
Expand All @@ -57,7 +55,7 @@ const displayRooms = rooms;
function buildTimeSlots(dayEvents: OpenSpaceEvent[]) {
const timeMap = new Map<string, Record<string, OpenSpaceEvent>>();
for (const ev of dayEvents) {
const label = ev.startTime;
const label = fmtTime(ev.startISO);
if (!timeMap.has(label)) timeMap.set(label, {});
const slot = timeMap.get(label);
if (slot) slot[ev.room] = ev;
Expand Down Expand Up @@ -87,7 +85,7 @@ const hasEvents = sortedDates.length > 0;
{timeSlots.length > 0 ? (
<div class="osp-grid" style={`--osp-cols: ${displayRooms.length}`}>
<div class="osp-grid-header">
<div class="osp-time-col osp-header-cell">Time</div>
<div class="osp-time-col osp-header-cell">Time (CEST)</div>
{displayRooms.map((room) => (
<div class="osp-room-col osp-header-cell">{room}</div>
))}
Expand Down
14 changes: 10 additions & 4 deletions src/pages/session/open-space/[slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,19 @@ export async function getStaticPaths() {

const { event } = Astro.props as { event: OpenSpaceEvent };

const tz = "Europe/Warsaw";

const dateLabel = new Date(event.date + "T12:00:00Z").toLocaleDateString(
"en-GB",
{ timeZone: "Europe/Warsaw", weekday: "long", day: "numeric", month: "long", year: "numeric" }
{ timeZone: tz, weekday: "long", day: "numeric", month: "long", year: "numeric" }
);

const timeLabel = (() => {
const start = new Date(event.startISO).toLocaleTimeString("en-GB", { timeZone: tz, hour: "2-digit", minute: "2-digit" });
const end = new Date(event.endISO).toLocaleTimeString("en-GB", { timeZone: tz, hour: "2-digit", minute: "2-digit" });
return `${start} \u2013 ${end} CEST`;
})();

const backUrl = event.date
? `/open-spaces#osp-day-${event.date}`
: "/open-spaces";
Expand All @@ -47,9 +55,7 @@ const backUrl = event.date
<dt class="font-bold text-text">Date:</dt>
<dd class="text-text">{dateLabel}</dd>
<dt class="font-bold text-text">Time:</dt>
<dd class="text-text">
{event.startTime} &ndash; {event.endTime}
</dd>
<dd class="text-text">{timeLabel}</dd>
</dl>

<div class="mb-8">
Expand Down
12 changes: 6 additions & 6 deletions src/utils/openSpaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface OpenSpaceEvent {

function stripHtml(s: string): string {
return s
.replace(/[<>]/g, "")
.replace(/<[^>]*(?:>|$)/g, "")
.replace(/https?:\/\/ep[^.]*\.europython\.eu(\/[^\s<!]+)/g, "[$1]($1)")
.replace(/https?:\/\/[^\s]+/g, "")
.trim()
Expand All @@ -36,7 +36,7 @@ function stripHtml(s: string): string {

function detectRoom(rawDesc: string): string {
const plain = rawDesc
.replace(/[<>]/g, "")
.replace(/<[^>]*(?:>|$)/g, "")
.replace(/https?:\/\/ep[^.]*\.europython\.eu(\/[^\s<!]+)/g, "[$1]($1)")
.replace(/https?:\/\/[^\s]+/g, "")
.replace(/&#39;/g, "'")
Expand All @@ -55,7 +55,7 @@ function detectRoom(rawDesc: string): string {

function extractHost(rawDesc: string): string {
const plain = rawDesc
.replace(/[<>]/g, "")
.replace(/<[^>]*(?:>|$)/g, "")
.replace(/&#39;/g, "'")
.replace(/&amp;/g, "&")
.replace(/\\n/g, "\n");
Expand Down Expand Up @@ -150,8 +150,8 @@ function parseICal(ics: string): OpenSpaceEvent[] {
const summary = getVal("SUMMARY");
const rawDescription = getVal("DESCRIPTION");
const organizer = getVal("ORGANIZER");
let dtStartRaw = getVal("DTSTART");
let dtEndRaw = getVal("DTEND");
const dtStartRaw = getVal("DTSTART");
const dtEndRaw = getVal("DTEND");
if (!dtStartRaw) continue;

const startDt = parseDt(dtStartRaw);
Expand All @@ -175,7 +175,7 @@ function parseICal(ics: string): OpenSpaceEvent[] {
);
if (descMatch) {
fullDescription = descMatch[1]
.replace(/[<>]/g, "")
.replace(/<[^>]*(?:>|$)/g, "")
.replace(/&#39;/g, "'")
.replace(/&amp;/g, "&")
.replace(/\\n/g, "\n")
Expand Down
Loading