feat: dynamic time format rendering in workflows based on user settings (#10229)

This commit is contained in:
Monto authored and GitHub committed 2023-07-19 10:30:37 -04:00
1 parent 1ad4f7247e
commit 26e458be6d
25 files changed
+205 -56

No files matched your search

@@ -14,6 +14,7 @@ import { IS_PRODUCTION } from "@calcom/lib/constants";
import { getErrorFromUnknown } from "@calcom/lib/errors";
import { HttpError as HttpCode } from "@calcom/lib/http-error";
import { getTranslation } from "@calcom/lib/server/i18n";
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
import { prisma, bookingMinimalSelect } from "@calcom/prisma";
import { BookingStatus } from "@calcom/prisma/enums";
import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
@@ -59,6 +60,7 @@ async function getBooking(bookingId: number) {
id: true,
username: true,
timeZone: true,
timeFormat: true,
email: true,
name: true,
locale: true,
@@ -108,6 +110,7 @@ async function getBooking(bookingId: number) {
email: user.email,
name: user.name!,
timeZone: user.timeZone,
timeFormat: getTimeFormatStringFromUserTimeFormat(user.timeFormat),
language: { translate: t, locale: user.locale ?? "en" },
id: user.id,
},
@@ -163,6 +166,7 @@ async function handlePaymentSuccess(event: Stripe.Event) {
username: true,
credentials: true,
timeZone: true,
timeFormat: true,
email: true,
name: true,
locale: true,
@@ -216,6 +220,7 @@ async function handlePaymentSuccess(event: Stripe.Event) {
email: user.email,
name: user.name!,
timeZone: user.timeZone,
timeFormat: getTimeFormatStringFromUserTimeFormat(user.timeFormat),
language: { translate: t, locale: user.locale ?? "en" },
},
attendees: attendeesList,