Now owners can set their time zone and users can see available times relatively to their current time zone

This commit is contained in:
Leonardo Stenico committed 2021-04-16 04:09:22 +02:00
1 parent d1f602b616
commit 96e2b762c6
6 files changed
+545 -13

No files matched your search

+4 -2
View File
@@ -12,7 +12,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
username: user,
},
select: {
credentials: true
credentials: true,
timeZone: true
}
});
@@ -34,6 +35,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
requestBody: {
timeMin: req.query.date + "T00:00:00.00Z",
timeMax: req.query.date + "T23:59:59.59Z",
timeZone: currentUser.timeZone,
items: [{
"id": "primary"
}]
@@ -44,4 +46,4 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
res.status(200).json(availability);
});
}
}
}