From f4e6edd19edd626bdfc6aab7a2d923b2f4375770 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 22 Feb 2025 09:47:48 +0200 Subject: [PATCH] feat(views/calendar): basic recursion for calendar root --- src/public/app/widgets/view_widgets/calendar_view.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/public/app/widgets/view_widgets/calendar_view.ts b/src/public/app/widgets/view_widgets/calendar_view.ts index 8a7e797bb..9cdb06978 100644 --- a/src/public/app/widgets/view_widgets/calendar_view.ts +++ b/src/public/app/widgets/view_widgets/calendar_view.ts @@ -215,10 +215,17 @@ export default class CalendarView extends ViewMode { const events: EventSourceInput = []; for (const note of notes) { - const startDate = note.getAttributeValue("label", "startDate"); + const startDate = note.getLabelValue("startDate") ?? note.getLabelValue("dateNote"); const customTitle = note.getAttributeValue("label", "calendar:title"); const color = note.getAttributeValue("label", "calendar:color") ?? note.getAttributeValue("label", "color") ?? undefined; + if (note.hasChildren()) { + const childrenEventData = await this.#buildEvents(note.getChildNoteIds()); + if (childrenEventData.length > 0) { + events.push(childrenEventData); + } + } + if (!startDate) { continue; } @@ -243,7 +250,7 @@ export default class CalendarView extends ViewMode { } } - return events; + return events.flat(); } static async #parseCustomTitle(customTitleValue: string | null, note: FNote, allowRelations = true): Promise {