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

@ -1,3 +1,12 @@
/**
* Column information container
* Contains both identifier and actual data for a column
*/
export interface IColumnInfo {
identifier: string; // "2024-11-13" (date mode) or "person-1" (resource mode)
data: Date | any; // Date for date-mode, IResource for resource-mode
}
/**
* IColumnDataSource - Defines the contract for providing column data
*
@ -6,10 +15,10 @@
*/
export interface IColumnDataSource {
/**
* Get the list of column identifiers to render
* @returns Array of identifiers (dates or resource IDs)
* Get the list of columns to render
* @returns Array of column information
*/
getColumns(): Date[];
getColumns(): IColumnInfo[];
/**
* Get the type of columns this datasource provides