fix missing date in book page (#1430)
This commit is contained in:
parent
57eeb48a8e
commit
09c4040ce5
1 changed files with 9 additions and 4 deletions
|
@ -183,6 +183,14 @@ const BookingPage = (props: BookingPageProps) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const parseDate = (date: string | null) => {
|
||||||
|
if (!date) return "No date";
|
||||||
|
const parsedZone = parseZone(date);
|
||||||
|
if (!parsedZone?.isValid()) return "Invalid date";
|
||||||
|
const formattedTime = parsedZone?.format(timeFormat);
|
||||||
|
return formattedTime + ", " + dayjs(date).toDate().toLocaleString(i18n.language, { dateStyle: "full" });
|
||||||
|
};
|
||||||
|
|
||||||
const bookEvent = (booking: BookingFormValues) => {
|
const bookEvent = (booking: BookingFormValues) => {
|
||||||
telemetry.withJitsu((jitsu) =>
|
telemetry.withJitsu((jitsu) =>
|
||||||
jitsu.track(telemetryEventTypes.bookingConfirmed, collectPageParameters())
|
jitsu.track(telemetryEventTypes.bookingConfirmed, collectPageParameters())
|
||||||
|
@ -284,10 +292,7 @@ const BookingPage = (props: BookingPageProps) => {
|
||||||
)}
|
)}
|
||||||
<p className="mb-4 text-green-500">
|
<p className="mb-4 text-green-500">
|
||||||
<CalendarIcon className="inline-block w-4 h-4 mr-1 -mt-1" />
|
<CalendarIcon className="inline-block w-4 h-4 mr-1 -mt-1" />
|
||||||
{(date && parseZone(date)?.format(timeFormat)) ||
|
{parseDate(date)}
|
||||||
"No date" +
|
|
||||||
", " +
|
|
||||||
dayjs(date).toDate().toLocaleString(i18n.language, { dateStyle: "full" })}
|
|
||||||
</p>
|
</p>
|
||||||
<p className="mb-8 text-gray-600 dark:text-white">{props.eventType.description}</p>
|
<p className="mb-8 text-gray-600 dark:text-white">{props.eventType.description}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue