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

@ -91,12 +91,15 @@ export class EventRenderingService {
* Handle GRID_RENDERED event - render events in the current grid
*/
private handleGridRendered(event: CustomEvent): void {
const { container, dates } = event.detail;
const { container, columns } = event.detail;
if (!container || !dates || dates.length === 0) {
if (!container || !columns || columns.length === 0) {
return;
}
// Extract dates from columns
const dates = columns.map((col: any) => col.data as Date);
// Calculate startDate and endDate from dates array
const startDate = dates[0];
const endDate = dates[dates.length - 1];