Improves date handling and event stacking

Enhances date validation and timezone handling using DateService, ensuring data integrity and consistency.

Refactors event rendering and dragging to correctly handle date transformations.

Adds a test plan for event stacking and z-index management.

Fixes edge cases in navigation and date calculations for week/year boundaries and DST transitions.
This commit is contained in:
Janus C. H. Knudsen 2025-10-04 00:32:26 +02:00
parent a86a736340
commit 9bc082eed4
20 changed files with 1641 additions and 41 deletions

View file

@ -40,7 +40,7 @@ export class DateEventRenderer implements EventRendererStrategy {
private dateService: DateService;
constructor() {
const timezone = calendarConfig.getTimezone?.() || 'Europe/Copenhagen';
const timezone = calendarConfig.getTimezone?.();
this.dateService = new DateService(timezone);
this.setupDragEventListeners();
}
@ -102,6 +102,7 @@ export class DateEventRenderer implements EventRendererStrategy {
private applyDragStyling(element: HTMLElement): void {
element.classList.add('dragging');
element.style.removeProperty("margin-left");
}
@ -174,8 +175,9 @@ export class DateEventRenderer implements EventRendererStrategy {
endDate = this.dateService.addDays(endDate, extraDays);
}
element.dataset.start = startDate.toISOString();
element.dataset.end = endDate.toISOString();
// Convert to UTC before storing as ISO string
element.dataset.start = this.dateService.toUTC(startDate);
element.dataset.end = this.dateService.toUTC(endDate);
}
/**