mirror of
https://github.com/zadam/trilium.git
synced 2025-10-26 07:46:30 +01:00
feat(views/calendar): basic recursion for calendar root
This commit is contained in:
@@ -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<string[]> {
|
||||
|
||||
Reference in New Issue
Block a user