Skip to content

Commit 865580e

Browse files
committed
Fix event summary page crashing for dates
If you specify a date in the metadata when creating a new event (which you do not do with the default metadata catalog), the event summary page will crash the app. This patch should fix that.
1 parent eef58e5 commit 865580e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/components/events/partials/wizards/summaryTables/MetadataSummaryTable.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const MetadataSummaryTable = ({
1414
header
1515
}: {
1616
metadataCatalogs: MetadataCatalog[],
17-
formikValues: { [key: string]: string | string[] | boolean },
17+
formikValues: { [key: string]: string | string[] | boolean | Date },
1818
header: string,
1919
}) => {
2020
const { t } = useTranslation();
@@ -54,6 +54,10 @@ const MetadataSummaryTable = ({
5454
)
5555
}
5656

57+
if (fieldValue instanceof Date) {
58+
fieldValue = t("dateFormats.dateTime.short", { dateTime: fieldValue })
59+
}
60+
5761
metadata = metadata.concat({
5862
name: metadataFields[i].id,
5963
label: metadataFields[i].label,

0 commit comments

Comments
 (0)