mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 19:49:01 +01:00 
			
		
		
		
	feat(calendar_view): allow rendering multiple events from multiple relation
This commit is contained in:
		
							parent
							
								
									a8509d8b1d
								
							
						
					
					
						commit
						1b4281cf77
					
				| @ -65,19 +65,22 @@ export default class CalendarView extends ViewMode { | |||||||
|                 continue; |                 continue; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             const eventData: typeof events[0] = { |             const titles = await CalendarView.#parseCustomTitle(customTitle, note); | ||||||
|                 title: (await CalendarView.#parseCustomTitle(customTitle, note))[0], |             for (const title of titles) { | ||||||
|                 start: startDate |                 const eventData: typeof events[0] = { | ||||||
|             }; |                     title: title, | ||||||
|  |                     start: startDate | ||||||
|  |                 }; | ||||||
| 
 | 
 | ||||||
|             const endDate = new Date(note.getAttributeValue("label", "endDate") ?? startDate); |                 const endDate = new Date(note.getAttributeValue("label", "endDate") ?? startDate); | ||||||
|             if (endDate) { |                 if (endDate) { | ||||||
|                 // Fullcalendar end date is exclusive, not inclusive.
 |                     // Fullcalendar end date is exclusive, not inclusive.
 | ||||||
|                 endDate.setDate(endDate.getDate() + 1); |                     endDate.setDate(endDate.getDate() + 1); | ||||||
|                 eventData.end = endDate.toISOString().substring(0, 10); |                     eventData.end = endDate.toISOString().substring(0, 10); | ||||||
|  |                 } | ||||||
|  | 
 | ||||||
|  |                 events.push(eventData); | ||||||
|             } |             } | ||||||
| 
 |  | ||||||
|             events.push(eventData); |  | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         return events; |         return events; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran