Refactors date handling in calendar components

Updates event and column date parsing to use identifier instead of data attribute

Improves date handling consistency across multiple calendar managers and renderers
Replaces direct Date casting with dateService.parseISO() for more robust date parsing
This commit is contained in:
Janus C. H. Knudsen 2025-11-18 16:43:50 +01:00
parent 8e52d670d6
commit 0f10d44037
3 changed files with 14 additions and 14 deletions

View file

@ -102,7 +102,7 @@ export class DateEventRenderer implements IEventRenderer {
public handleDragMove(payload: IDragMoveEventPayload): void {
const swpEvent = payload.draggedClone as SwpEventElement;
const columnDate = this.dateService.parseISO(payload.columnBounds!!.data as Date);
const columnDate = this.dateService.parseISO(payload.columnBounds!!.identifier);
swpEvent.updatePosition(columnDate, payload.snappedY);
}
@ -118,7 +118,7 @@ export class DateEventRenderer implements IEventRenderer {
// Recalculate timestamps with new column date
const currentTop = parseFloat(payload.draggedClone.style.top) || 0;
const swpEvent = payload.draggedClone as SwpEventElement;
const columnDate = this.dateService.parseISO(payload.newColumn.data as Date);
const columnDate = this.dateService.parseISO(payload.newColumn.identifier);
swpEvent.updatePosition(columnDate, currentTop);
}
}
@ -130,7 +130,7 @@ export class DateEventRenderer implements IEventRenderer {
console.log('🎯 DateEventRenderer: Converting all-day to timed event', {
eventId: payload.calendarEvent.id,
targetColumn: payload.targetColumn.data as Date,
targetColumn: payload.targetColumn.identifier,
snappedY: payload.snappedY
});