mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +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); |         const events = await CalendarView.buildEvents(noteIds); | ||||||
|  |  | ||||||
|         expect(events).toHaveLength(2); |         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" }); |         expect(events[1]).toMatchObject({ title: "Note 2", start: "2025-05-07T13:36:00", end: "2025-05-08" }); | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -384,17 +384,17 @@ export default class CalendarView extends ViewMode { | |||||||
|         } |         } | ||||||
|  |  | ||||||
|         for (const title of titles) { |         for (const title of titles) { | ||||||
|             startDate = (startTime ? `${startDate}T${startTime}:00` : startDate); |             if (endTime && !endDate) { | ||||||
|             if (!endDate) { |  | ||||||
|                 if (!endTime) { |  | ||||||
|                 endDate = startDate; |                 endDate = startDate; | ||||||
|                 } else { |             } | ||||||
|  |  | ||||||
|  |             startDate = (startTime ? `${startDate}T${startTime}:00` : startDate); | ||||||
|  |             if (!endDate && !startTime) { | ||||||
|                 const endDateOffset = CalendarView.#offsetDate(endDate ?? startDate, 1); |                 const endDateOffset = CalendarView.#offsetDate(endDate ?? startDate, 1); | ||||||
|                 if (endDateOffset) { |                 if (endDateOffset) { | ||||||
|                     endDate = CalendarView.#formatDateToLocalISO(endDateOffset); |                     endDate = CalendarView.#formatDateToLocalISO(endDateOffset); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             } |  | ||||||
|  |  | ||||||
|             endDate = (endTime ? `${endDate}T${endTime}:00` : endDate); |             endDate = (endTime ? `${endDate}T${endTime}:00` : endDate); | ||||||
|             const eventData: EventInput = { |             const eventData: EventInput = { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user