This commit is contained in:
Janus C. H. Knudsen 2025-10-15 00:58:29 +02:00
parent bf4b9b5064
commit b3b930c1f9
6 changed files with 21 additions and 19 deletions

View file

@ -21,13 +21,10 @@ export class EventRenderingService {
private dragMouseLeaveHeaderListener: ((event: Event) => void) | null = null;
constructor(eventBus: IEventBus, eventManager: EventManager) {
constructor(eventBus: IEventBus, eventManager: EventManager, strategy: EventRendererStrategy) {
this.eventBus = eventBus;
this.eventManager = eventManager;
// Cache strategy at initialization
const calendarType = calendarConfig.getCalendarMode();
this.strategy = CalendarTypeFactory.getEventRenderer(calendarType);
this.strategy = strategy;
// Initialize DateService
const timezone = calendarConfig.getTimezone?.();

View file

@ -15,10 +15,12 @@ export class GridRenderer {
private cachedGridContainer: HTMLElement | null = null;
private cachedTimeAxis: HTMLElement | null = null;
private dateService: DateService;
private columnRenderer: ColumnRenderer;
constructor() {
constructor(columnRenderer: ColumnRenderer) {
const timezone = calendarConfig.getTimezone?.();
this.dateService = new DateService(timezone);
this.columnRenderer = columnRenderer;
}
public renderGrid(
@ -139,16 +141,13 @@ export class GridRenderer {
resourceData: ResourceCalendarData | null,
view: CalendarView
): void {
const calendarType = calendarConfig.getCalendarMode();
const columnRenderer = CalendarTypeFactory.getColumnRenderer(calendarType);
const context: ColumnRenderContext = {
currentWeek: currentDate, // ColumnRenderer expects currentWeek property
config: calendarConfig,
resourceData: resourceData
};
columnRenderer.render(columnContainer, context);
this.columnRenderer.render(columnContainer, context);
}
/**