Refactor calendar datasource architecture

Centralizes date calculation logic into DateColumnDataSource
Improves separation of concerns across rendering components

Key changes:
- Introduces IColumnInfo interface for flexible column data
- Moves date calculation from multiple managers to dedicated datasource
- Removes duplicate date rendering logic
- Prepares architecture for future resource-based views
This commit is contained in:
Janus C. H. Knudsen 2025-11-14 16:25:03 +01:00
parent 75a2d4913e
commit f86ae09ec3
15 changed files with 885 additions and 76 deletions

View file

@ -390,14 +390,15 @@ export class DateEventRenderer implements IEventRenderer {
}
protected getEventsForColumn(column: HTMLElement, events: ICalendarEvent[]): ICalendarEvent[] {
const columnDate = column.dataset.date;
if (!columnDate) {
const columnId = column.dataset.columnId;
if (!columnId) {
return [];
}
// Create start and end of day for interval overlap check
const columnStart = this.dateService.parseISO(`${columnDate}T00:00:00`);
const columnEnd = this.dateService.parseISO(`${columnDate}T23:59:59.999`);
// In date-mode, columnId is ISO date string like "2024-11-13"
const columnStart = this.dateService.parseISO(`${columnId}T00:00:00`);
const columnEnd = this.dateService.parseISO(`${columnId}T23:59:59.999`);
const columnEvents = events.filter(event => {
// Interval overlap: event overlaps with column day if event.start < columnEnd AND event.end > columnStart