Commit graph

192 commits

Author SHA1 Message Date
Janus C. H. Knudsen
53cf097a47 Introduces DateService for time zone handling
Adds DateService using date-fns-tz for robust time zone
conversions and date manipulations.

Refactors DateCalculator and TimeFormatter to utilize the
DateService, centralizing date logic and ensuring consistent
time zone handling throughout the application.

Improves event dragging by updating time displays and data
attributes, handling cross-midnight events correctly.
2025-10-03 16:47:42 +02:00
Janus C. H. Knudsen
1821d805d1 Comments out timestamp update in dragged clone
Comments out the timestamp update logic within the dragged clone functionality.

This change is a preliminary step towards refactoring the scroll logic, which will be managed by a dedicated scroll manager, decoupling it from the event renderer.
2025-10-03 16:33:26 +02:00
Janus C. H. Knudsen
38737762c5 Adds technical date and time formatting
Adds options for technical date and time formatting and includes the option to show seconds.

Updates time formatting to use UTC-to-local conversion and ensures consistent colon separators for time values.

Adjusts all-day event handling to preserve original start/end times.
2025-10-03 16:05:22 +02:00
Janus C. H. Knudsen
c8d78f472d Adds mock events data
Initializes a mock JSON file to provide sample data for events.
This data includes various event types with metadata.
2025-10-03 15:00:16 +02:00
Janus C. H. Knudsen
98ad46efab Preserves event duration during drag and drop
Ensures all-day events maintain their original duration
when dragged and dropped to a new date.

Calculates and applies the correct end date based on the
original event's span.
2025-10-03 00:37:37 +02:00
Janus C. H. Knudsen
576367974b Fixes all-day event dragging issues
Addresses issues with dragging all-day events, ensuring correct event placement and layout calculations after a drag and drop operation.
Specifically, ensures the correct event ID is used and updates the event layout when dragging all day events.
2025-10-02 23:58:03 +02:00
Janus C. H. Knudsen
89e8a3f7b2 wip 2025-10-02 23:11:26 +02:00
Janus C. H. Knudsen
88702e574a Improves drag and drop all-day event handling
Refines drag and drop behavior for all-day events.

Removes unnecessary logging and conditional logic in the
AllDayManager.

Simplifies column change handling in the EventRendererManager.
2025-10-02 17:40:58 +02:00
Janus C. H. Knudsen
5cdcd12e0a Updates all-day event overflow indicator
Ensures that the all-day event overflow indicator updates
correctly when the number of events changes, instead of
creating duplicate indicators.
Removes unused event click handling logic.
2025-10-02 17:30:48 +02:00
Janus C. H. Knudsen
496be2f7ce Improves all-day event overflow handling
Ensures correct display of all-day events when collapsed or expanded.

Improves the transition between collapsed and expanded states by
adjusting the overflow event visibility.
2025-10-02 16:57:43 +02:00
Janus C. H. Knudsen
0bf369907b Refactors all-day event overflow toggle.
Simplifies the all-day event overflow toggle logic by using distinct class names and avoiding direct class switching, improving code readability and maintainability.
2025-10-02 16:05:11 +02:00
Janus C. H. Knudsen
13b72b55b2 wip 2025-10-02 16:01:36 +02:00
Janus C. H. Knudsen
54acdb9b41 WIP 2025-10-02 15:57:11 +02:00
Janus C. H. Knudsen
0f2d96f76f Consolidates all-day event row limit
Centralizes the maximum number of displayed all-day event rows into a single constant.

This change ensures consistency and simplifies management of the all-day event row limit across the application.

Corrects off-by-one error in overflow count.
2025-10-02 15:37:01 +02:00
Janus C. H. Knudsen
135787146c Refines all-day event display
Improves the visual appearance of all-day events
by adjusting padding and margins.

Reduces padding in the all-day container and adds
margins to individual events for better spacing.
2025-10-02 01:11:32 +02:00
Janus C. H. Knudsen
f2ad13776f Improves all-day event row height calculation
Ensures consistent all-day event row height calculation across CSS and TypeScript.

The all-day event row height calculation is adjusted by removing redundant container padding from the TypeScript constant and synchronizing the CSS variable with the event height.

Additionally, the layout engine is directly tested in the test file for better coverage.
2025-10-02 01:03:35 +02:00
Janus C. H. Knudsen
a1e1c5d185 Removes unnecessary destroy methods 2025-10-01 22:38:15 +02:00
Janus C. H. Knudsen
4e5077364e Improves all-day event layout calculation
Refactors all-day event layout calculation to use the header elements directly.

This change improves the accuracy of event positioning
and fixes potential issues with date handling.
2025-10-01 21:47:05 +02:00
Janus C. H. Knudsen
d7867d4a9f Renders all-day events based on header data
Refactors all-day event rendering to use header column data.
This ensures events are rendered based on the actual visible
dates in the header, improving accuracy and responsiveness to view changes.

Removes direct dependency on week dates in `AllDayManager` and
`EventRenderingService`, instead, the all-day manager is instantiated
with event manager.

Updates `HeaderManager` to emit header bounds.
2025-10-01 21:27:13 +02:00
Janus C. H. Knudsen
ae3aab5dd0 Improves all-day event layout and drag behavior
Refactors all-day event layout calculation and rendering for improved accuracy and performance.

Improves drag-and-drop behavior for all-day events, ensuring correct event placement and column detection.

Addresses issues with event overflow display and provides a more responsive user experience.
2025-10-01 18:41:28 +02:00
Janus C. H. Knudsen
6a17bba343 Adds date-based column retrieval
Adds a method to retrieve column bounds based on a given date, enhancing date-specific event placement.

Removes unnecessary data storage for overflow event titles, simplifying overflow event handling.
2025-09-30 23:45:07 +02:00
Janus C. H. Knudsen
67dfb6e894 Adds event counting in columns
Implements a method to count the number of events
within a specific column, used for layout calculations.
2025-09-30 23:00:34 +02:00
Janus C. H. Knudsen
c7b9abde9a Improves all-day event height calculation.
Refactors all-day event height calculation to use the `currentLayouts` array, ensuring more accurate and reliable height adjustments.

This avoids querying the DOM directly and relies on the existing layout data for improved performance and correctness.
2025-09-30 22:49:16 +02:00
Janus C. H. Knudsen
cf463cc691 Refactors all-day event layout calculation
Improves all-day event drag and drop by recalculating layouts and applying differential updates to minimize DOM manipulations.

This change optimizes the update process by comparing current and new layouts, only updating elements with changed grid areas, leading to smoother transitions.
Removes obsolete code.
2025-09-30 22:35:07 +02:00
Janus C. H. Knudsen
6223bcd176 Improves all-day event display in collapsed mode
Enhances the all-day event display when collapsed by showing four rows (three events plus an overflow indicator).

Updates the overflow indicator logic to dynamically display the number of hidden events and allow the user to expand the view.
2025-09-30 15:24:58 +02:00
Janus C. H. Knudsen
c705869c9e Implements all-day event row collapsing
Adds functionality to collapse the all-day event rows when the number of rows exceeds a limit.

This improves the layout by preventing the all-day section from taking up too much space. A chevron button is added to allow users to expand/collapse the section.
2025-09-30 00:34:27 +02:00
Janus C. H. Knudsen
5417a2b6b1 Improves drag and drop functionality
Refactors drag and drop logic to use the dragged clone consistently, fixing issues with event handling and element manipulation during drag operations.
Also includes a fix where the original element is removed after a drag is completed.
Adds column bounds cache update after drag operations for improved column detection.
2025-09-30 00:13:52 +02:00
Janus C. H. Knudsen
83e01f9cb7 Improves all-day event drag and drop
Refactors all-day event conversion during drag and drop to
use the event payload, improving code clarity and reducing
redundancy.

Removes unnecessary style settings and fixes column detection
logic. Addresses an issue where event removal occurred before
successful placement.
2025-09-29 20:50:52 +02:00
Janus C. H. Knudsen
8b5420f367 Refactors event extraction to utility function
Moves event extraction logic to a shared utility function for reusability.

Removes redundant code and improves consistency in event handling.
The original duration is now mandatory.
2025-09-29 18:39:40 +02:00
Janus C. H. Knudsen
0d33b51ff8 Corrects dragged event clone position 2025-09-29 17:56:30 +02:00
Janus C. H. Knudsen
7fc401b1df Refactors layout engine tests to use arrays
Updates tests to use arrays instead of Maps for storing layouts.
This simplifies the data structures and allows for more straightforward assertions.
2025-09-28 13:45:15 +02:00
Janus C. H. Knudsen
6ccc071587 Refactors drag and drop column detection
Improves drag and drop functionality by refactoring column detection to use column bounds instead of dates.
This change enhances the accuracy and efficiency of determining the target column during drag operations.
It also removes redundant code and simplifies the logic in both the DragDropManager and AllDayManager.
2025-09-28 13:25:09 +02:00
Janus C. H. Knudsen
4141bffca4 Refactors all-day event layout calculation
Simplifies all-day event rendering by streamlining the layout
calculation and event placement process, using the AllDayLayoutEngine
to determine the grid positions. This removes deprecated methods
and improves overall code clarity.
2025-09-27 15:01:22 +02:00
Janus C. H. Knudsen
9dfd4574d8 Improves drag and drop for timed and all-day events
Refactors drag and drop handling to use a cloned event element,
ensuring correct positioning and styling during drag operations
for both regular timed events and all-day events.

This change streamlines the drag and drop process by:
- Creating a clone of the dragged event at the start of the drag.
- Passing the clone through the drag events.
- Handling all-day events with the AllDayManager
- Handling regular timed events with the EventRendererManager

This resolves issues with event positioning and styling during
drag, especially when moving events across columns or between
all-day and timed sections.
2025-09-26 22:53:49 +02:00
Janus C. H. Knudsen
0553089085 Improves all-day event drag and drop
Refactors all-day event drag and drop handling for improved accuracy and performance.

Introduces a shared `ColumnDetectionUtils` for consistent column detection.

Simplifies all-day conversion during drag, placing events in row 1 and calculating the column from the target date.

Implements differential updates during drag end, updating only changed events for smoother transitions.
2025-09-26 22:11:57 +02:00
Janus C. H. Knudsen
41d078e2e8 Improves all-day event layout calculation
Updates the all-day event layout engine for better event
rendering, especially when dealing with partial week views.

The layout engine now correctly clips events that start
before or end after the visible date range, ensuring that
only relevant portions of events are displayed.

It also fixes event ordering.

Includes new unit tests to validate date range filtering and
clipping logic.
2025-09-26 17:47:02 +02:00
Janus C. H. Knudsen
a551bc59ff Tests all-day event layout calculations
Adds comprehensive tests for the AllDayManager, covering various overlap scenarios.
Tests ensure correct row and column assignments for all-day events based on date ranges and overlaps.
Replaces individual event layout calculation with batch calculation for improved performance and test coverage.
2025-09-25 23:44:13 +02:00
Janus C. H. Knudsen
a624394ffb Improves all-day event layout calculation
Refactors all-day event rendering to use a layout engine
for overlap detection and positioning, ensuring events
are placed in available rows and columns.

Removes deprecated method and adds unit tests.
2025-09-25 23:38:17 +02:00
Janus C. H. Knudsen
274753936e Creates all-day container in header renderer
Ensures all-day container is created as part of the standard header structure, rather than on-demand.

Removes the request listener and logic for ensuring all-day container existence.
2025-09-25 20:39:48 +02:00
Janus C. H. Knudsen
4daf1f6975 Calculates all-day event container height correctly
Improves the calculation of the all-day event container's
height by finding the highest row number in use, ensuring
the container accurately reflects the space occupied by events.

Updates debug logging for clarity.
2025-09-25 18:17:37 +02:00
Janus C. H. Knudsen
1e20e23e77 Uses optimized grid creation for navigation
Ensures navigation grid uses the same creation method
as the initial load.

This ensures workweek and resource settings are respected,
creating a more consistent experience.
2025-09-25 17:55:13 +02:00
Janus C. H. Knudsen
710dda4c24 Refactors grid creation to GridRenderer
Centralizes grid creation logic within the GridRenderer
for better code organization and reusability. This change
moves the grid rendering functionality from
NavigationRenderer to GridRenderer and updates the
NavigationManager to use the new GridRenderer.
2025-09-25 17:46:49 +02:00
Janus C. H. Knudsen
e20e23651c wip 2025-09-23 23:51:21 +02:00
Janus C. H. Knudsen
32894cca82 Supports dynamic event types; refactors navigation DOM access
Enables dynamic event types by reading the 'type' field from raw event data instead of using a hardcoded value.

Removes DOM element caching for calendar and grid containers in the navigation manager, opting for direct DOM queries. Eliminates associated cache clearing and post-animation header event emission.
2025-09-23 23:39:01 +02:00
Janus C. H. Knudsen
48d1fd681c Major refactor into type safe TS
With a risk oof rolling it all back
2025-09-23 20:44:15 +02:00
Janus C. H. Knudsen
c08fa02c29 Disables fill: forwards for spacer height animation
Removes the `fill: 'forwards'` property to ensure CSS `calc()` takes over the header spacer's height after the animation concludes.
2025-09-23 16:30:30 +02:00
Janus C. H. Knudsen
eb7d257b52 Removes header height animation setup
Eliminates manual DOM manipulation for temporary header height adjustment during slide-in animations. This is no longer necessary.
2025-09-23 16:26:34 +02:00
Janus C. H. Knudsen
ffa0bcafc3 Optimizes animation speed and event flow
Reduces the duration of a UI height animation for a snappier feel.
Disables a specific `header:ready` event emission during navigation rendering.
2025-09-23 09:46:47 +02:00
Janus C. H. Knudsen
6498b0ba8e Refactors all-day event rendering and DOM access
Decouples all-day event rendering, making it reactive to header readiness with period data.
Eliminates explicit DOM element caching, simplifying element access.
Enhances the `header:ready` event payload with `startDate` and `endDate`.
Improves all-day row height animation and calculation.
2025-09-22 23:37:43 +02:00
Janus C. H. Knudsen
f5e9909935 Separates all-day event rendering; handles header lifecycle
Event rendering strategies now exclusively handle timed events, while all-day events are managed by a dedicated renderer.

Centralizes calendar header creation within `GridRenderer`, ensuring the header element is always present from initial DOM construction. `HeaderManager` and `ScrollManager` now react to a `header:ready` event, which signifies the header is fully initialized.

Synchronizes all-day event rendering with header readiness, temporarily queuing events until the header is prepared. Emits an `allday:checkHeight` event to prompt all-day container height adjustments after rendering.
2025-09-22 21:53:18 +02:00