Implements strategy pattern for calendar views

Refactors the grid management to use a strategy pattern, allowing for different calendar views (week, month, day) to be rendered using separate strategy implementations.

This approach improves code organization, reduces complexity within the main grid manager, and makes it easier to add new view types in the future.

The strategy pattern centralizes view-specific logic, improves testability, and reduces code duplication.

A month view strategy has been added and is now selectable via UI.
This commit is contained in:
Janus Knudsen 2025-08-20 19:52:18 +02:00
parent 3ddc6352f2
commit 414ef1caaf
6 changed files with 527 additions and 252 deletions

View file

@ -46,7 +46,7 @@
<swp-view-selector>
<swp-view-button data-view="day">Day</swp-view-button>
<swp-view-button data-view="week" data-active="true">Week</swp-view-button>
<swp-view-button data-view="month" disabled>Month</swp-view-button>
<swp-view-button data-view="month">Month</swp-view-button>
</swp-view-selector>
<swp-workweek-presets>