Booking Module Improvements (#3221)

* Fix momentary render of dates before skeleton

* Fix Hydration issue - We shouldnt guess timezone on server as it would be different from client causing hydration error

* Fix wrong trpcQuery result when clicking on a particular date. Also, fix last day of the month being never available

* Fix as per PR Feedback
This commit is contained in:
Hariom Balhara authored and GitHub committed 2022-07-06 08:25:41 -06:00
1 parent b7d4e3885e
commit b3f7e8e322
2 files changed
+6 -8

No files matched your search

+2 -5
View File
@@ -151,16 +151,13 @@ export const slotsRouter = createRouter().query("getSchedule", {
const startTime =
input.timeZone === "Etc/GMT"
? dayjs.utc(input.startTime)
: dayjs.utc(input.startTime).tz(input.timeZone, true);
: dayjs(input.startTime).utc().tz(input.timeZone);
const endTime =
input.timeZone === "Etc/GMT"
? dayjs.utc(input.endTime)
: dayjs.utc(input.endTime).tz(input.timeZone, true);
input.timeZone === "Etc/GMT" ? dayjs.utc(input.endTime) : dayjs(input.endTime).utc().tz(input.timeZone);
if (!startTime.isValid() || !endTime.isValid()) {
throw new TRPCError({ message: "Invalid time range given.", code: "BAD_REQUEST" });
}
let currentSeats: CurrentSeats | undefined = undefined;
const userSchedules = await Promise.all(