Commit graph

6 commits

Author SHA1 Message Date
Janus Knudsen
4b4dbdc0d6 Refactors event system to use CoreEvents
Migrates the application to use a new CoreEvents system.

This change removes the legacy EventTypes constant file and updates all managers, renderers, and core components to use the CoreEvents constant file for event emission and subscription.

This improves code maintainability and promotes a consistent eventing strategy across the application. Adds validation to EventBus emit and extractCategory functions.
2025-08-20 20:22:51 +02:00
Janus Knudsen
7d513600d8 Refactors date handling for ISO week compatibility
Centralizes all date calculations into a new `DateCalculator` class for better maintainability and consistency.

Ensures correct ISO week handling (Monday as the first day) throughout the calendar.

Updates `CalendarConfig` to use ISO day numbering (1-7 for Mon-Sun) for work week definitions.

Fixes issue where date calculations were inconsistent.
Enhances event rendering and navigation.
Updates navigation logic to use pre-rendered events.
Removes the need for `CONTAINER_READY_FOR_EVENTS` event.
2025-08-20 00:39:31 +02:00
Janus Knudsen
18f7953db4 Refactors date calculations into DateCalculator
Centralizes date calculation logic into a dedicated DateCalculator
class for improved maintainability and testability.

Removes redundant date calculation methods from CalendarManager,
ColumnRenderer, HeaderRenderer and NavigationRenderer, and utilizes
the DateCalculator for these calculations.

Updates components to use DateCalculator for consistent date
handling, including week start determination, date formatting,
and "is today" checks.
2025-08-18 23:42:03 +02:00
Janus Knudsen
d017d48bd6 Adds work week configuration feature
Implements configurable work week presets, allowing users to customize the days displayed in the calendar.

This includes:
- Defining work week settings (work days, day names, total days).
- Providing predefined work week presets (standard, compressed, weekend, full week).
- Adding UI elements to switch between presets.
- Updating grid and header rendering logic to reflect the selected work week.
- Emitting events when the work week changes, triggering necessary UI updates and data re-renders.

This provides a more flexible and personalized calendar experience.
2025-08-18 22:27:17 +02:00
Janus Knudsen
26f0cb8aaa Refactors calendar initialization with factory
Implements a factory pattern for manager creation and
initialization, improving dependency management and
extensibility.

This change replaces direct manager instantiation with a
`ManagerFactory` that handles dependency injection. This
enhances code organization and testability. It also includes
an initialization sequence diagram for better understanding
of the calendar's architecture and data flow.
2025-08-17 23:44:30 +02:00
Janus Knudsen
32ee35eb02 Refactors grid and navigation rendering
Attempt 1
2025-08-17 22:54:00 +02:00