Refactors DateCalculator to be a static class
This change refactors the DateCalculator class to be a static class. This removes the need to instantiate DateCalculator in multiple managers and renderers, simplifying dependency management and ensuring consistent date calculations across the application. The configuration is now initialized once at the application start.
This commit is contained in:
parent
0da875a224
commit
b8b44ddae8
11 changed files with 107 additions and 83 deletions
|
|
@ -3,6 +3,7 @@ import { eventBus } from './core/EventBus.js';
|
|||
import { calendarConfig } from './core/CalendarConfig.js';
|
||||
import { CalendarTypeFactory } from './factories/CalendarTypeFactory.js';
|
||||
import { ManagerFactory } from './factories/ManagerFactory.js';
|
||||
import { DateCalculator } from './utils/DateCalculator.js';
|
||||
|
||||
/**
|
||||
* Initialize the calendar application with simple direct calls
|
||||
|
|
@ -13,6 +14,9 @@ async function initializeCalendar(): Promise<void> {
|
|||
// Use the singleton calendar configuration
|
||||
const config = calendarConfig;
|
||||
|
||||
// Initialize DateCalculator with config first
|
||||
DateCalculator.initialize(config);
|
||||
|
||||
// Initialize the CalendarTypeFactory before creating managers
|
||||
CalendarTypeFactory.initialize();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue