feat: replace Date constructor with parseISO for improved date handling across calendar components #25

This commit is contained in:
Linus Rath
2026-03-26 17:42:44 +01:00
parent 9b25b6d03e
commit 733e99f094
9 changed files with 22 additions and 18 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
import { parseISO } from 'date-fns';
import type { Email, Attachment, CalendarEvent, CalendarParticipant, EmailBodyPart } from '@/lib/jmap/types';
export type InvitationMethod =
@@ -534,7 +535,7 @@ function addDurationToDate(start: string, duration: string, _timeZone?: string |
const minutes = parseInt(match[4] || '0');
const seconds = parseInt(match[5] || '0');
const date = new Date(start);
const date = parseISO(start);
if (isNaN(date.getTime())) return null;
const isUTC = start.endsWith('Z') || start.includes('+');