Skip to content

Commit 63d6547

Browse files
committed
Clarify external event display duration
1 parent 59f3d3e commit 63d6547

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/bases/calendar-core.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ import { TimeblockCreationModal } from "../modals/TimeblockCreationModal";
3535
import { openTaskSelector } from "../modals/TaskSelectorWithCreateModal";
3636
import { TimeblockInfoModal } from "../modals/TimeblockInfoModal";
3737

38+
const MIN_EXTERNAL_TIMED_EVENT_DURATION_MS = 1;
39+
3840
export interface CalendarEvent {
3941
id: string;
4042
title: string;
@@ -661,8 +663,8 @@ export function createICSEvent(icsEvent: ICSEvent, plugin: TaskNotesPlugin): Cal
661663
return {
662664
id: icsEvent.id,
663665
title: icsEvent.title,
664-
start: start,
665-
end: end,
666+
start,
667+
end,
666668
allDay: icsEvent.allDay,
667669
backgroundColor: backgroundColor,
668670
borderColor: borderColor,
@@ -709,7 +711,7 @@ function normalizeExternalTimedEventRange(
709711
return { start, end };
710712
}
711713

712-
const normalizedEnd = new Date(endDate.getTime() + 1);
714+
const normalizedEnd = new Date(endDate.getTime() + MIN_EXTERNAL_TIMED_EVENT_DURATION_MS);
713715
return {
714716
start,
715717
end: formatExternalTimedEventEnd(normalizedEnd, end),

0 commit comments

Comments
 (0)