fix: start and end date for ooo entry (#13284)

Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: sean-brydon <[email protected]>
Co-authored-by: sean-brydon <[email protected]>
This commit is contained in:
authored and GitHub committed 2024-01-19 04:00:21 +00:00
1 parent 833a91375e
commit a25cd43ddf
4 files changed
+36 -28

No files matched your search

@@ -134,12 +134,14 @@ export const outOfOfficeCreate = async ({ ctx, input }: TBookingRedirect) => {
if (existingOutOfOfficeEntry) {
throw new TRPCError({ code: "BAD_REQUEST", message: "booking_redirect_infinite_not_allowed" });
}
const startDateUtc = dayjs.utc(startDate).add(input.offset, "minute");
const endDateUtc = dayjs.utc(endDate).add(input.offset, "minute");
const createdRedirect = await prisma.outOfOfficeEntry.create({
data: {
uuid: uuidv4(),
start: dayjs(startDate).startOf("day").toISOString(),
end: dayjs(endDate).endOf("day").toISOString(),
start: startDateUtc.startOf("day").toISOString(),
end: endDateUtc.endOf("day").toISOString(),
userId: ctx.user.id,
toUserId: toUserId,
createdAt: new Date(),
@@ -5,6 +5,7 @@ export const ZOutOfOfficeInputSchema = z.object({
startDate: z.date(),
endDate: z.date(),
}),
offset: z.number(),
toTeamUserId: z.number().nullable(),
});
@@ -103,13 +103,17 @@
background-color: var(--cal-bg-subtle);
}
.react-daterange-picker {
width: 100%;
}
.react-daterange-picker > .react-daterange-picker__wrapper {
padding: 0.625rem 0.75rem;
font-size: 0.875rem;
line-height: 1.25rem;
border-radius: 0.375rem;
width: 100%;
border-color: var(--cal-border);
width: 360px;
display: flex;
flex-direction: row;
align-items: center;