diff --git a/packages/features/bookings/Booker/components/EventMeta.tsx b/packages/features/bookings/Booker/components/EventMeta.tsx
index 59b9dd35e3..4b896df51e 100644
--- a/packages/features/bookings/Booker/components/EventMeta.tsx
+++ b/packages/features/bookings/Booker/components/EventMeta.tsx
@@ -9,7 +9,7 @@ import { Calendar, Globe } from "@calcom/ui/components/icon";
import { fadeInUp } from "../config";
import { useBookerStore } from "../store";
-import { formatEventFromToTime } from "../utils/dates";
+import { FromToTime } from "../utils/dates";
import { useEvent } from "../utils/event";
const TimezoneSelect = dynamic(() => import("@calcom/ui").then((mod) => mod.TimezoneSelect), {
@@ -42,25 +42,25 @@ export const EventMeta = () => {
{t("former_time")}
- {formatEventFromToTime(
- rescheduleBooking.startTime.toString(),
- null,
- timeFormat,
- timezone,
- i18n.language
- )}
+
)}
{selectedTimeslot && (
- {formatEventFromToTime(
- selectedTimeslot,
- selectedDuration,
- timeFormat,
- timezone,
- i18n.language
- )}
+
)}
diff --git a/packages/features/bookings/Booker/utils/dates.ts b/packages/features/bookings/Booker/utils/dates.ts
deleted file mode 100644
index 7306119b08..0000000000
--- a/packages/features/bookings/Booker/utils/dates.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import dayjs from "@calcom/dayjs";
-import type { TimeFormat } from "@calcom/lib/timeFormat";
-
-export const formatEventFromToTime = (
- date: string,
- duration: number | null,
- timeFormat: TimeFormat,
- timeZone: string,
- language: string
-) => {
- const start = dayjs(date).tz(timeZone);
- const end = duration ? start.add(duration, "minute") : null;
- return `${start.format("dddd")}, ${start
- .toDate()
- .toLocaleDateString(language, { dateStyle: "long" })} ${start.format(timeFormat)} ${
- end ? `– ${end.format(timeFormat)}` : ``
- }`;
-};
diff --git a/packages/features/bookings/Booker/utils/dates.tsx b/packages/features/bookings/Booker/utils/dates.tsx
new file mode 100644
index 0000000000..7584c1add8
--- /dev/null
+++ b/packages/features/bookings/Booker/utils/dates.tsx
@@ -0,0 +1,38 @@
+import dayjs from "@calcom/dayjs";
+import type { TimeFormat } from "@calcom/lib/timeFormat";
+
+interface EventFromToTime {
+ date: string;
+ duration: number | null;
+ timeFormat: TimeFormat;
+ timeZone: string;
+ language: string;
+}
+
+export const formatEventFromToTime = ({
+ date,
+ duration,
+ timeFormat,
+ timeZone,
+ language,
+}: EventFromToTime) => {
+ const start = dayjs(date).tz(timeZone);
+ const end = duration ? start.add(duration, "minute") : null;
+ const formattedDate = `${start.format("dddd")}, ${start
+ .toDate()
+ .toLocaleDateString(language, { dateStyle: "long" })}`;
+ const formattedTime = `${start.format(timeFormat)} ${end ? `– ${end.format(timeFormat)}` : ``}`;
+
+ return { date: formattedDate, time: formattedTime };
+};
+
+export const FromToTime = (props: EventFromToTime) => {
+ const formatted = formatEventFromToTime(props);
+ return (
+ <>
+ {formatted.date}
+
+ {formatted.time}
+ >
+ );
+};