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:
parent
6bbf2d8adb
commit
a86a736340
6 changed files with 69 additions and 77 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue