mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	feat(views/calendar): basic recursion for calendar root
This commit is contained in:
		
							parent
							
								
									530340f753
								
							
						
					
					
						commit
						f4e6edd19e
					
				@ -215,10 +215,17 @@ export default class CalendarView extends ViewMode {
 | 
				
			|||||||
        const events: EventSourceInput = [];
 | 
					        const events: EventSourceInput = [];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for (const note of notes) {
 | 
					        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 customTitle = note.getAttributeValue("label", "calendar:title");
 | 
				
			||||||
            const color = note.getAttributeValue("label", "calendar:color") ??  note.getAttributeValue("label", "color") ?? undefined;
 | 
					            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) {
 | 
					            if (!startDate) {
 | 
				
			||||||
                continue;
 | 
					                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[]> {
 | 
					    static async #parseCustomTitle(customTitleValue: string | null, note: FNote, allowRelations = true): Promise<string[]> {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user