diff --git a/packages/features/bookings/Booker/components/BookEventForm/BookFormAsModal.tsx b/packages/features/bookings/Booker/components/BookEventForm/BookFormAsModal.tsx
index ab399400c4..b3d2016103 100644
--- a/packages/features/bookings/Booker/components/BookEventForm/BookFormAsModal.tsx
+++ b/packages/features/bookings/Booker/components/BookEventForm/BookFormAsModal.tsx
@@ -1,12 +1,14 @@
import type { ReactNode } from "react";
+import React from "react";
import { useIsPlatform, useGetEventTypeById } from "@calcom/atoms/monorepo";
-import dayjs from "@calcom/dayjs";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Badge, Dialog, DialogContent } from "@calcom/ui";
+import { getDurationFormatted } from "../../../components/event-meta/Duration";
import { useTimePreferences } from "../../../lib";
import { useBookerStore } from "../../store";
+import { FromTime } from "../../utils/dates";
import { useEvent } from "../../utils/event";
const BookEventFormWrapper = ({ children, onCancel }: { onCancel: () => void; children: ReactNode }) => {
@@ -42,10 +44,9 @@ export const BookEventFormWrapperComponent = ({
child: ReactNode;
eventLength?: number;
}) => {
- const { t } = useLocale();
+ const { i18n, t } = useLocale();
const selectedTimeslot = useBookerStore((state) => state.selectedTimeslot);
const selectedDuration = useBookerStore((state) => state.selectedDuration);
- const parsedSelectedTimeslot = dayjs(selectedTimeslot);
const { timeFormat, timezone } = useTimePreferences();
if (!selectedTimeslot) {
return null;
@@ -53,15 +54,18 @@ export const BookEventFormWrapperComponent = ({
return (
<>
+
-
- {parsedSelectedTimeslot.format("LL")} {parsedSelectedTimeslot.tz(timezone).format(timeFormat)}
-
+
{(selectedDuration || eventLength) && (
- {selectedDuration || eventLength}
+ {getDurationFormatted(selectedDuration || eventLength, t)}
)}
diff --git a/packages/features/bookings/Booker/utils/dates.tsx b/packages/features/bookings/Booker/utils/dates.tsx
index 0cb8fc5caf..5e1b0ac6ea 100644
--- a/packages/features/bookings/Booker/utils/dates.tsx
+++ b/packages/features/bookings/Booker/utils/dates.tsx
@@ -8,6 +8,31 @@ interface EventFromToTime {
language: string;
}
+interface EventFromTime {
+ date: string;
+ timeFormat: TimeFormat;
+ timeZone: string;
+ language: string;
+}
+
+export const formatEventFromTime = ({ date, timeFormat, timeZone, language }: EventFromTime) => {
+ const startDate = new Date(date);
+ const formattedDate = new Intl.DateTimeFormat(language, {
+ timeZone,
+ dateStyle: "full",
+ }).format(startDate);
+
+ const formattedTime = new Intl.DateTimeFormat(language, {
+ timeZone,
+ timeStyle: "short",
+ hour12: timeFormat === TimeFormat.TWELVE_HOUR ? true : false,
+ })
+ .format(startDate)
+ .toLowerCase();
+
+ return { date: formattedDate, time: formattedTime };
+};
+
export const formatEventFromToTime = ({
date,
duration,
@@ -46,3 +71,12 @@ export const FromToTime = (props: EventFromToTime) => {
>
);
};
+
+export const FromTime = (props: EventFromTime) => {
+ const formatted = formatEventFromTime(props);
+ return (
+ <>
+ {formatted.date}, {formatted.time}
+ >
+ );
+};
diff --git a/packages/features/bookings/components/event-meta/AvailableEventLocations.tsx b/packages/features/bookings/components/event-meta/AvailableEventLocations.tsx
index 2effedd45c..66370b6d51 100644
--- a/packages/features/bookings/components/event-meta/AvailableEventLocations.tsx
+++ b/packages/features/bookings/components/event-meta/AvailableEventLocations.tsx
@@ -28,7 +28,7 @@ function RenderIcon({
return (

);
diff --git a/packages/features/bookings/components/event-meta/Duration.tsx b/packages/features/bookings/components/event-meta/Duration.tsx
index 66db6ba6ac..e76a681c76 100644
--- a/packages/features/bookings/components/event-meta/Duration.tsx
+++ b/packages/features/bookings/components/event-meta/Duration.tsx
@@ -9,7 +9,9 @@ import { Badge } from "@calcom/ui";
import type { PublicEvent } from "../../types";
/** Render X mins as X hours or X hours Y mins instead of in minutes once >= 60 minutes */
-const getDurationFormatted = (mins: number, t: TFunction) => {
+export const getDurationFormatted = (mins: number | undefined, t: TFunction) => {
+ if (!mins) return null;
+
const hours = Math.floor(mins / 60);
mins %= 60;
// format minutes string