Refactors date handling to use DateService

Standardizes date manipulation across the application by leveraging the DateService.
This change improves consistency and reduces code duplication by removing redundant date calculations.
This commit is contained in:
Janus C. H. Knudsen 2025-10-03 20:59:52 +02:00
parent 6bbf2d8adb
commit a86a736340
6 changed files with 69 additions and 77 deletions

View file

@ -153,14 +153,14 @@ export class NavigationManager {
}
private navigateToPreviousWeek(): void {
this.targetWeek.setDate(this.targetWeek.getDate() - 7);
this.targetWeek = this.dateService.addWeeks(this.targetWeek, -1);
const weekToShow = new Date(this.targetWeek);
this.animationQueue++;
this.animateTransition('prev', weekToShow);
}
private navigateToNextWeek(): void {
this.targetWeek.setDate(this.targetWeek.getDate() + 7);
this.targetWeek = this.dateService.addWeeks(this.targetWeek, 1);
const weekToShow = new Date(this.targetWeek);
this.animationQueue++;
this.animateTransition('next', weekToShow);