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
+3 -2
View File
@@ -1,3 +1,4 @@
import { parseISO } from 'date-fns';
import type {
CalendarEvent,
CalendarEventAlert,
@@ -53,7 +54,7 @@ export function computeFireTime(
baseTime = new Date(event.utcEnd).getTime();
} else {
// Compute end from start + duration
const startMs = new Date(event.start).getTime();
const startMs = parseISO(event.start).getTime();
if (Number.isNaN(startMs)) return null;
const durationMin = parseDuration(event.duration);
baseTime = startMs + durationMin * 60000;
@@ -61,7 +62,7 @@ export function computeFireTime(
} else {
baseTime = event.utcStart
? new Date(event.utcStart).getTime()
: new Date(event.start).getTime();
: parseISO(event.start).getTime();
}
if (Number.isNaN(baseTime)) return null;