diff --git a/frontend/src/lib/dateUtils.ts b/frontend/src/lib/dateUtils.ts index d949504..6d611ed 100644 --- a/frontend/src/lib/dateUtils.ts +++ b/frontend/src/lib/dateUtils.ts @@ -12,10 +12,10 @@ export function toLocalDatetime( timezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone ): string { if (!utcDate) return ''; - return DateTime.fromISO(utcDate, { zone: 'UTC' }) + const isoString = DateTime.fromISO(utcDate, { zone: 'UTC' }) .setZone(timezone) - .toISO({ suppressSeconds: true, includeOffset: false }) - .slice(0, 16); + .toISO({ suppressSeconds: true, includeOffset: false }); + return isoString ? isoString.slice(0, 16) : ''; } /**