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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user