Generate getSchedule response using the invitee timeZone (#7574)

* Generate getSchedule response using the invitee timeZone

* Prevents too much diffing

* Adds follow up to TODO to issue

---------

Co-authored-by: zomars <zomars@me.com>
This commit is contained in:
Efraín Rochín
2023-03-07 19:24:36 -07:00
committed by GitHub
co-authored by zomars
parent c97fecf436
commit e1601960df
@@ -367,8 +367,10 @@ export async function getSchedule(input: z.infer<typeof getScheduleSchema>, ctx:
const computedAvailableSlots = availableTimeSlots.reduce(
(
r: Record<string, { time: string; users: string[]; attendees?: number; bookingUid?: string }[]>,
{ time: time, ...passThroughProps }
{ time: _time, ...passThroughProps }
) => {
// TODO: Adds unit tests to prevent regressions in getSchedule (try multiple timezones)
const time = _time.tz(input.timeZone);
r[time.format("YYYY-MM-DD")] = r[time.format("YYYY-MM-DD")] || [];
r[time.format("YYYY-MM-DD")].push({
...passThroughProps,