Change date format for RecurringBookings (#2707)

* Change date format for RecurringBookings

* Missing bookingId query param

Co-authored-by: Leo Giovanetti <hello@leog.me>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
pull/2730/head
Joe Au-Yeung 2022-05-11 03:59:49 -04:00 committed by GitHub
parent 50f1fe544e
commit fb436996c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 16 deletions

View File

@ -153,7 +153,7 @@ const BookingPage = ({
const recurringMutation = useMutation(createRecurringBooking, { const recurringMutation = useMutation(createRecurringBooking, {
onSuccess: async (responseData = []) => { onSuccess: async (responseData = []) => {
const { attendees = [], recurringEventId } = responseData[0] || {}; const { attendees = [], id, recurringEventId } = responseData[0] || {};
const location = (function humanReadableLocation(location) { const location = (function humanReadableLocation(location) {
if (!location) { if (!location) {
return; return;
@ -177,6 +177,7 @@ const BookingPage = ({
email: attendees[0].email, email: attendees[0].email,
location, location,
eventName: profile.eventName || "", eventName: profile.eventName || "",
bookingId: id,
}, },
}); });
}, },

View File

@ -310,14 +310,6 @@ export default function Success(props: SuccessProps) {
<div className="col-span-2 mb-6">{eventName}</div> <div className="col-span-2 mb-6">{eventName}</div>
<div className="font-medium">{t("when")}</div> <div className="font-medium">{t("when")}</div>
<div className="col-span-2 mb-6"> <div className="col-span-2 mb-6">
{date.format("MMMM DD, YYYY")}
<br />
{date.format("LT")} - {date.add(props.eventType.length, "m").format("LT")}{" "}
<span className="text-bookinglight">
({localStorage.getItem("timeOption.preferredTimeZone") || dayjs.tz.guess()})
</span>
</div>
<div className="col-span-2">
<RecurringBookings <RecurringBookings
isReschedule={reschedule === "true"} isReschedule={reschedule === "true"}
eventType={props.eventType} eventType={props.eventType}
@ -327,7 +319,7 @@ export default function Success(props: SuccessProps) {
/> />
</div> </div>
<div className="font-medium">{t("who")}</div> <div className="font-medium">{t("who")}</div>
<div className="col-span-2"> <div className="col-span-2 mb-6">
{bookingInfo?.user && ( {bookingInfo?.user && (
<div className="mb-3"> <div className="mb-3">
<p>{bookingInfo.user.name}</p> <p>{bookingInfo.user.name}</p>
@ -556,9 +548,9 @@ function RecurringBookings({
{eventType.recurringEvent?.count && {eventType.recurringEvent?.count &&
recurringBookings.slice(0, 4).map((dateStr, idx) => ( recurringBookings.slice(0, 4).map((dateStr, idx) => (
<div key={idx} className="mb-2"> <div key={idx} className="mb-2">
{dayjs(dateStr).format("dddd, DD MMMM YYYY")} {dayjs(dateStr).format("MMMM DD, YYYY")}
<br /> <br />
{dayjs(dateStr).format(is24h ? "H:mm" : "h:mma")} - {eventType.length} mins{" "} {dayjs(dateStr).format("LT")} - {dayjs(dateStr).add(eventType.length, "m").format("LT")}{" "}
<span className="text-bookinglight"> <span className="text-bookinglight">
({localStorage.getItem("timeOption.preferredTimeZone") || dayjs.tz.guess()}) ({localStorage.getItem("timeOption.preferredTimeZone") || dayjs.tz.guess()})
</span> </span>
@ -575,9 +567,9 @@ function RecurringBookings({
{eventType.recurringEvent?.count && {eventType.recurringEvent?.count &&
recurringBookings.slice(4).map((dateStr, idx) => ( recurringBookings.slice(4).map((dateStr, idx) => (
<div key={idx} className="mb-2"> <div key={idx} className="mb-2">
{dayjs(dateStr).format("dddd, DD MMMM YYYY")} {dayjs(dateStr).format("MMMM DD, YYYY")}
<br /> <br />
{dayjs(dateStr).format(is24h ? "H:mm" : "h:mma")} - {eventType.length} mins{" "} {dayjs(dateStr).format("LT")} - {dayjs(dateStr).add(eventType.length, "m").format("LT")}{" "}
<span className="text-bookinglight"> <span className="text-bookinglight">
({localStorage.getItem("timeOption.preferredTimeZone") || dayjs.tz.guess()}) ({localStorage.getItem("timeOption.preferredTimeZone") || dayjs.tz.guess()})
</span> </span>
@ -589,9 +581,9 @@ function RecurringBookings({
</> </>
) : !eventType.recurringEvent.freq ? ( ) : !eventType.recurringEvent.freq ? (
<> <>
{date.format("dddd, DD MMMM YYYY")} {date.format("MMMM DD, YYYY")}
<br /> <br />
{date.format(is24h ? "H:mm" : "h:mma")} - {eventType.length} mins{" "} {date.format("LT")} - {date.add(eventType.length, "m").format("LT")}{" "}
<span className="text-bookinglight"> <span className="text-bookinglight">
({localStorage.getItem("timeOption.preferredTimeZone") || dayjs.tz.guess()}) ({localStorage.getItem("timeOption.preferredTimeZone") || dayjs.tz.guess()})
</span> </span>