Skip to content

Add end of the day. #1250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 22, 2025
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
5 changes: 3 additions & 2 deletions src/components/schedule/break.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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;
---

<div class="break" style={style} aria-label=`${time} ${title}` >
<div class={className? className: "break"} style={style} aria-label=`${time} ${title}` >
{time}{" "}
{title}
<span class="sr-only">{time} {title}</span>
Expand Down
43 changes: 42 additions & 1 deletion src/components/schedule/day.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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);

---

<div class="day"
Expand Down Expand Up @@ -362,7 +375,7 @@ const dateText = format(date, "eeee - do MMMM");
<h2>{format(slot.start, "HH:mm")}</h2>
</div>

{sessionsByTime[slot.startTime]
{(sessionsByTime[slot.startTime] ?? [])
.sort(sortSessionByRooms)
.map((session) => {
const style = getSessionStyle(session);
Expand Down Expand Up @@ -407,7 +420,14 @@ const dateText = format(date, "eeee - do MMMM");
</div>
))
}

</div>

<Break
title="End of the Day"
time={endStart}
className="day-end"
/>
</div>
<div class="h-12"></div>
</div>
Expand All @@ -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) {
}

Expand Down Expand Up @@ -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;
Expand Down
14 changes: 14 additions & 0 deletions src/pages/session/[slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,20 @@ const nextSessionsOrdered = sameRoomNextSession
</>
)
}
{
entry.data.end && (
<>
<dt class="font-bold">End:</dt>
<dd>
{formatInTimeZone(
entry.data.end,
"Europe/Prague",
"HH:mm 'on' dd MMMM yyyy",
)}
</dd>
</>
)
}
<dt class="font-bold">Duration:</dt>
<dd>{entry.data.duration} minutes</dd>
</dl>
Expand Down