mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	fix(calendar): handling of start time/end time
This commit is contained in:
		| @@ -169,7 +169,7 @@ describe("Promoted attributes", () => { | ||||
|         const events = await CalendarView.buildEvents(noteIds); | ||||
|  | ||||
|         expect(events).toHaveLength(2); | ||||
|         expect(events[0]).toMatchObject({ title: "Note 1", start: "2025-05-05T13:30:00", end: "2025-05-05T13:30:00" }); | ||||
|         expect(events[0]).toMatchObject({ title: "Note 1", start: "2025-05-05T13:30:00" }); | ||||
|         expect(events[1]).toMatchObject({ title: "Note 2", start: "2025-05-07T13:36:00", end: "2025-05-08" }); | ||||
|     }); | ||||
|  | ||||
|   | ||||
| @@ -384,15 +384,15 @@ export default class CalendarView extends ViewMode { | ||||
|         } | ||||
|  | ||||
|         for (const title of titles) { | ||||
|             if (endTime && !endDate) { | ||||
|                 endDate = startDate; | ||||
|             } | ||||
|  | ||||
|             startDate = (startTime ? `${startDate}T${startTime}:00` : startDate); | ||||
|             if (!endDate) { | ||||
|                 if (!endTime) { | ||||
|                     endDate = startDate; | ||||
|                 } else { | ||||
|                     const endDateOffset = CalendarView.#offsetDate(endDate ?? startDate, 1); | ||||
|                     if (endDateOffset) { | ||||
|                         endDate = CalendarView.#formatDateToLocalISO(endDateOffset); | ||||
|                     } | ||||
|             if (!endDate && !startTime) { | ||||
|                 const endDateOffset = CalendarView.#offsetDate(endDate ?? startDate, 1); | ||||
|                 if (endDateOffset) { | ||||
|                     endDate = CalendarView.#formatDateToLocalISO(endDateOffset); | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user