Skip to content

Commit 585346c

Browse files
committed
Display end times in Schedule
1 parent 1aa5ef5 commit 585346c

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/app/conf/2025/schedule/_components/schedule-list.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,19 @@ function getSessionsByDay(
101101
}
102102
}
103103

104+
const timeFormat = new Intl.DateTimeFormat(undefined, {
105+
hour: "2-digit",
106+
minute: "2-digit",
107+
})
108+
const formatBlockTime = (start: string, end?: string) => {
109+
const startDate = parseISO(start)
110+
if (end) {
111+
const endDate = parseISO(end)
112+
return timeFormat.formatRange(startDate, endDate)
113+
}
114+
return timeFormat.format(startDate)
115+
}
116+
104117
export interface ScheduleListProps {
105118
showFilter?: boolean
106119
scheduleData: ScheduleSession[]
@@ -199,12 +212,9 @@ export function ScheduleList({
199212
<div className="mr-px flex flex-col max-lg:ml-px lg:flex-row">
200213
<div className="relative border-neu-50 bg-neu-50 dark:bg-neu-0 max-lg:-mx-px max-lg:my-px max-lg:border-x lg:mr-px">
201214
<span className="typography-body-sm mt-3 inline-block w-20 whitespace-nowrap pb-0.5 pl-4 lg:mr-6 lg:w-28 lg:pb-4 lg:pl-0">
202-
{parseISO(sessionDate).toLocaleTimeString(
203-
undefined,
204-
{
205-
hour: "2-digit",
206-
minute: "2-digit",
207-
},
215+
{formatBlockTime(
216+
sessionDate,
217+
sessions[0]?.event_end,
208218
)}
209219
</span>
210220
</div>

0 commit comments

Comments
 (0)