fix: slots in email embed sorted (#25676)

* fix: slots in email embed sorted

* fix: removed mutating of original array

* fix: incorrect access of sortedTimes

---------

Co-authored-by: Dhairyashil Shinde <93669429+dhairyashiil@users.noreply.github.com>
This commit is contained in:
spandevandDhairyashil Shinde authored and GitHub committed 2025-12-20 13:12:50 +00:00
1 parent 6e5b812286
commit d8ddb466b0
1 file changed
+4 -3
+4 -3
View File
@@ -539,7 +539,8 @@ const EmailEmbedPreview = ({
Object.keys(selectedDateAndTime)
.sort()
.map((key) => {
const firstSlotOfSelectedDay = selectedDateAndTime[key][0];
const sortedTimes = [...selectedDateAndTime[key]].sort();
const firstSlotOfSelectedDay = sortedTimes[0];
const selectedDate = dayjs(firstSlotOfSelectedDay)
.tz(timezone)
.format("dddd, MMMM D, YYYY");
@@ -573,8 +574,8 @@ const EmailEmbedPreview = ({
<table style={{ borderCollapse: "separate", borderSpacing: "0px 4px" }}>
<tbody>
<tr style={{ height: "25px" }}>
{selectedDateAndTime[key]?.length > 0 &&
selectedDateAndTime[key].map((time) => {
{sortedTimes?.length > 0 &&
sortedTimes.map((time) => {
// If teamId is present on eventType and is not null, it means it is a team event.
// So we add 'team/' to the url.
const bookingURL = `${eventType.bookerUrl}/${