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:
parent
8e52d670d6
commit
0f10d44037
3 changed files with 14 additions and 14 deletions
|
|
@ -216,7 +216,7 @@ export class EventRenderingService {
|
|||
cloneElement.style.display = '';
|
||||
|
||||
console.log('🚪 EventRendererManager: Received drag:mouseleave-header', {
|
||||
targetDate,
|
||||
targetColumn: targetColumn?.identifier,
|
||||
originalElement: originalElement,
|
||||
cloneElement: cloneElement
|
||||
});
|
||||
|
|
@ -296,7 +296,7 @@ export class EventRenderingService {
|
|||
}
|
||||
|
||||
// Re-render target column if exists and different from source
|
||||
if (targetColumn && (targetColumn.data as Date) !== (originalSourceColumn?.data as Date)) {
|
||||
if (targetColumn && targetColumn.identifier !== originalSourceColumn?.identifier) {
|
||||
await this.renderSingleColumn(targetColumn);
|
||||
}
|
||||
}
|
||||
|
|
@ -317,7 +317,7 @@ export class EventRenderingService {
|
|||
*/
|
||||
private async renderSingleColumn(column: IColumnBounds): Promise<void> {
|
||||
// Get events for just this column's date
|
||||
const dateString = (column.data as Date).toISOString().split('T')[0];
|
||||
const dateString = column.identifier;
|
||||
const columnStart = this.dateService.parseISO(`${dateString}T00:00:00`);
|
||||
const columnEnd = this.dateService.parseISO(`${dateString}T23:59:59.999`);
|
||||
|
||||
|
|
@ -343,7 +343,7 @@ export class EventRenderingService {
|
|||
}
|
||||
|
||||
console.log('🔄 EventRendererManager: Re-rendered single column', {
|
||||
columnDate: column.data as Date,
|
||||
columnDate: column.identifier,
|
||||
eventsCount: timedEvents.length
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue