From a83d99df9d0d6d21c684ff9f6e952c0cfd78113d Mon Sep 17 00:00:00 2001 From: Niko Date: Tue, 20 May 2025 00:39:13 +0200 Subject: [PATCH 1/3] Add end of the day. --- src/components/schedule/break.astro | 5 ++-- src/components/schedule/day.astro | 43 ++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/components/schedule/break.astro b/src/components/schedule/break.astro index 3da93b677..33fa3920b 100644 --- a/src/components/schedule/break.astro +++ b/src/components/schedule/break.astro @@ -3,12 +3,13 @@ export interface Props { time: string; title: string; style?: any; + className?: string; } -const { time, title, style }: Props = Astro.props; +const { time, title, style, className }: Props = Astro.props; --- -
+
{time}{" "} {title} {time} {title} diff --git a/src/components/schedule/day.astro b/src/components/schedule/day.astro index 35731623d..601cde153 100644 --- a/src/components/schedule/day.astro +++ b/src/components/schedule/day.astro @@ -322,6 +322,19 @@ posters.forEach((poster) => { const date = parseISO(dayName); const dateText = format(date, "eeee - do MMMM"); + + + + + const lastEndTime = Math.max( + ...slots.flatMap((slot) => slot.sessions.map((s) => timeToNumber(s.endTime))) + ); + + const endStart = numberToTime(lastEndTime); + const endStartDate = addMinutes(parseISO(dayName), lastEndTime); + const endEndDate = addMinutes(endStartDate, 10); + const endEnd = numberToTime(lastEndTime + 10); + ---
{format(slot.start, "HH:mm")}
- {sessionsByTime[slot.startTime] + {(sessionsByTime[slot.startTime] ?? []) .sort(sortSessionByRooms) .map((session) => { const style = getSessionStyle(session); @@ -407,7 +420,14 @@ const dateText = format(date, "eeee - do MMMM");
)) } +
+ +
@@ -426,6 +446,19 @@ const dateText = format(date, "eeee - do MMMM"); { width: 100%; } + + + :global(.day-end) { + display: flex; + align-items: center; + text-align: center; + justify-items: center; + background-color: #FCFBFA; + border-radius: 10px; + margin: 10px 1.5rem; + padding:2px 8px; + font-size: 0.8rem; +} :global(body) { } @@ -548,6 +581,14 @@ const dateText = format(date, "eeee - do MMMM"); grid-column: var(--col-start) / var(--col-end); } + + :global(.day-end){ + font-size: 1.2rem; + margin: 2px; + padding: 8px; + } + + .time { padding: 8px; grid-column: 1 / 2; From 849033b92b90f845db5b1b780e19ef84e7f8d383 Mon Sep 17 00:00:00 2001 From: Niko Date: Tue, 20 May 2025 07:08:23 +0200 Subject: [PATCH 2/3] Add end time to session page. --- src/components/schedule/session.astro | 2 +- src/pages/session/[slug].astro | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/schedule/session.astro b/src/components/schedule/session.astro index 7747f3e1a..cb6d10c8f 100644 --- a/src/components/schedule/session.astro +++ b/src/components/schedule/session.astro @@ -109,7 +109,7 @@ const hasFooter = true; "time title" "time footer"; - grid-template-columns: 60px 1fr; + grid-template-columns: 60px 1fr;https://github.com/EuroPython/website/pull/1250 } .room-info { diff --git a/src/pages/session/[slug].astro b/src/pages/session/[slug].astro index d7f851105..b8aba73b0 100644 --- a/src/pages/session/[slug].astro +++ b/src/pages/session/[slug].astro @@ -21,6 +21,7 @@ export async function getStaticPaths() { const sessions = await getCollection("sessions"); const { entry } = Astro.props; +console.log(entry) const slug = entry.id; const speakers = await getEntries(entry.data.speakers); @@ -97,6 +98,20 @@ const nextSessionsOrdered = sameRoomNextSession ) } + { + entry.data.end && ( + <> +
End:
+
+ {formatInTimeZone( + entry.data.end, + "Europe/Prague", + "HH:mm 'on' dd MMMM yyyy", + )} +
+ + ) + }
Duration:
{entry.data.duration} minutes
From f6f3f02feffa8be1b4066b981c2d1ab771797ed9 Mon Sep 17 00:00:00 2001 From: Niko Date: Wed, 21 May 2025 17:11:37 +0200 Subject: [PATCH 3/3] Clean up. --- src/components/schedule/day.astro | 10 +++++----- src/components/schedule/session.astro | 2 +- src/pages/session/[slug].astro | 1 - 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/schedule/day.astro b/src/components/schedule/day.astro index 601cde153..969231505 100644 --- a/src/components/schedule/day.astro +++ b/src/components/schedule/day.astro @@ -423,11 +423,11 @@ const dateText = format(date, "eeee - do MMMM"); - +
diff --git a/src/components/schedule/session.astro b/src/components/schedule/session.astro index 38927d5f3..6b253ee1f 100644 --- a/src/components/schedule/session.astro +++ b/src/components/schedule/session.astro @@ -110,7 +110,7 @@ const hasFooter = true; "time title" "time footer"; - grid-template-columns: 60px 1fr;https://github.com/EuroPython/website/pull/1250 + grid-template-columns: 60px 1fr; } .room-info { diff --git a/src/pages/session/[slug].astro b/src/pages/session/[slug].astro index 07b4a7188..781530e4a 100644 --- a/src/pages/session/[slug].astro +++ b/src/pages/session/[slug].astro @@ -22,7 +22,6 @@ export async function getStaticPaths() { const sessions = await getCollection("sessions"); const { entry } = Astro.props; -console.log(entry) const slug = entry.id; const speakers = await getEntries(entry.data.speakers);