From 9fd112a36bb2394faac79245278c946a1b87153c Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Mon, 20 May 2024 15:27:38 -0700 Subject: [PATCH 1/5] =?UTF-8?q?fix:=20=F0=9F=90=9B=20correct=20type=20impo?= =?UTF-8?q?rt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/components/availability/PersonalAvailability.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/availability/PersonalAvailability.svelte b/src/lib/components/availability/PersonalAvailability.svelte index 515b1759..d24733c2 100644 --- a/src/lib/components/availability/PersonalAvailability.svelte +++ b/src/lib/components/availability/PersonalAvailability.svelte @@ -1,7 +1,7 @@ diff --git a/src/lib/stores/availabilityStores.ts b/src/lib/stores/availabilityStores.ts index 206adba5..12e64457 100644 --- a/src/lib/stores/availabilityStores.ts +++ b/src/lib/stores/availabilityStores.ts @@ -8,7 +8,7 @@ import { ZotDate } from "$lib/utils/ZotDate"; export const BLOCK_LENGTH: number = 15; -const getTimeFromHourMinuteString = (hourMinuteString: HourMinuteString): number => { +export const getTimeFromHourMinuteString = (hourMinuteString: HourMinuteString): number => { const [hours, minutes] = hourMinuteString.split(":"); return Number(hours) * TimeConstants.MINUTES_PER_HOUR + Number(minutes); diff --git a/src/routes/availability/[slug]/+page.server.ts b/src/routes/availability/[slug]/+page.server.ts index 1adcf630..068889d1 100644 --- a/src/routes/availability/[slug]/+page.server.ts +++ b/src/routes/availability/[slug]/+page.server.ts @@ -27,6 +27,8 @@ export const load: PageServerLoad = (async ({ locals, params }) => { availability: user ? await getAvailability(user, params?.slug) : null, meetingId: params?.slug as string | undefined, defaultDates: (await getMeetingDates(params?.slug)) ?? [], + startTime: (await getExistingMeeting(params?.slug)).from_time, + endTime: (await getExistingMeeting(params?.slug)).to_time, }; }) satisfies PageServerLoad; diff --git a/src/routes/availability/[slug]/+page.svelte b/src/routes/availability/[slug]/+page.svelte index 9dcc7bf2..a94f7daf 100644 --- a/src/routes/availability/[slug]/+page.svelte +++ b/src/routes/availability/[slug]/+page.svelte @@ -1,15 +1,22 @@ From 43fc7ecefd037a2cdf2c48fb4d6519cc60cfd9d8 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Mon, 20 May 2024 17:07:45 -0700 Subject: [PATCH 5/5] =?UTF-8?q?feat:=20=E2=9C=A8=20read=20meeting=20name?= =?UTF-8?q?=20from=20db?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/availability/[slug]/+page.server.ts | 3 +-- src/routes/availability/[slug]/+page.svelte | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/routes/availability/[slug]/+page.server.ts b/src/routes/availability/[slug]/+page.server.ts index 068889d1..98e80ca4 100644 --- a/src/routes/availability/[slug]/+page.server.ts +++ b/src/routes/availability/[slug]/+page.server.ts @@ -26,9 +26,8 @@ export const load: PageServerLoad = (async ({ locals, params }) => { form: await superValidate(_loginSchema), availability: user ? await getAvailability(user, params?.slug) : null, meetingId: params?.slug as string | undefined, + meetingData: await getExistingMeeting(params?.slug), defaultDates: (await getMeetingDates(params?.slug)) ?? [], - startTime: (await getExistingMeeting(params?.slug)).from_time, - endTime: (await getExistingMeeting(params?.slug)).to_time, }; }) satisfies PageServerLoad; diff --git a/src/routes/availability/[slug]/+page.svelte b/src/routes/availability/[slug]/+page.svelte index a94f7daf..a4f78dd1 100644 --- a/src/routes/availability/[slug]/+page.svelte +++ b/src/routes/availability/[slug]/+page.svelte @@ -57,8 +57,8 @@ let form: HTMLFormElement; onMount(async () => { - $startTime = data.startTime as HourMinuteString; - $endTime = data.endTime as HourMinuteString; + $startTime = data.meetingData.from_time as HourMinuteString; + $endTime = data.meetingData.to_time as HourMinuteString; }); $: availabilityTimeBlocks.set( @@ -73,7 +73,7 @@

- Sample Meeting Winter 2024 + {data.meetingData.title}

{#if $isEditingAvailability}