From 52ac2d6af5be05fbed1ae67bf5e41f5bfa23730a Mon Sep 17 00:00:00 2001 From: Ahmedhossamdev Date: Wed, 20 Nov 2024 14:23:06 -0800 Subject: [PATCH] feat: Add schedule accordion component for displaying trip schedules --- .../scheduleAccordionItem.svelte | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 src/components/schedules-for-stop/scheduleAccordionItem.svelte diff --git a/src/components/schedules-for-stop/scheduleAccordionItem.svelte b/src/components/schedules-for-stop/scheduleAccordionItem.svelte new file mode 100644 index 0000000..de55bb2 --- /dev/null +++ b/src/components/schedules-for-stop/scheduleAccordionItem.svelte @@ -0,0 +1,85 @@ + + + + + {schedule.tripHeadsign} + + + + + + + + + + + + + {#each renderScheduleTable(schedule).amTimes as [hour, times]} + + + + + {/each} + + + + + {#each renderScheduleTable(schedule).pmTimes as [hour, times]} + + + + + {/each} + +
HourMinutes
AM
{formatHour(hour)}:00 + {#each times as stopTime, index (index)} + + {extractMinutes(stopTime.arrivalTime)} + {index < times.length - 1 ? ', ' : ''} + + {/each} +
PM
{formatHour(hour)}:00 + {#each times as stopTime, index (index)} + + {extractMinutes(stopTime.arrivalTime)} + {index < times.length - 1 ? ', ' : ''} + + {/each} +
+