Improves all-day event layout calculation

Refactors all-day event layout calculation to use the header elements directly.

This change improves the accuracy of event positioning
and fixes potential issues with date handling.
This commit is contained in:
Janus C. H. Knudsen 2025-10-01 21:47:05 +02:00
parent d7867d4a9f
commit 4e5077364e
2 changed files with 7 additions and 13 deletions

View file

@ -5,8 +5,6 @@ import { CoreEvents } from '../constants/CoreEvents';
import { HeaderRenderContext } from '../renderers/HeaderRenderer';
import { ResourceCalendarData } from '../types/CalendarTypes';
import { DragMouseEnterHeaderEventPayload, DragMouseLeaveHeaderEventPayload, HeaderReadyEventPayload } from '../types/EventTypes';
import { DateCalculator } from '../utils/DateCalculator';
import { PositionUtils } from '../utils/PositionUtils';
import { ColumnDetectionUtils } from '../utils/ColumnDetectionUtils';
/**
@ -138,10 +136,6 @@ export class HeaderManager {
// Setup event listeners on the new content
this.setupHeaderDragListeners();
// Calculate period from current date
const weekStart = DateCalculator.getISOWeekStart(currentDate);
const weekEnd = DateCalculator.addDays(weekStart, 6);
// Notify other managers that header is ready with period data
const payload: HeaderReadyEventPayload = {
headerElements: ColumnDetectionUtils.getHeaderColumns(),