diff --git a/apps/webapp/app/utils.ts b/apps/webapp/app/utils.ts index a099e857d2e..4469a11ebe1 100644 --- a/apps/webapp/app/utils.ts +++ b/apps/webapp/app/utils.ts @@ -97,11 +97,16 @@ export function formatDateTime( date: Date, style: "medium" | "long" = "medium" ): string { - switch (style) { - case "long": - return dateFormatterLong.format(date); - case "medium": - return dateFormatter.format(date); + try { + switch (style) { + case "long": + return dateFormatterLong.format(date); + case "medium": + return dateFormatter.format(date); + } + } catch (error) { + console.error(error); + return "Unknown"; } }