fix(calendar): use 1-hour default duration for grid click instead of 15 minutes

The click-to-create handler was using SNAP_INTERVAL_MINUTES (15) as the
initial event duration. Now uses DEFAULT_EVENT_DURATION_MINUTES (60) to
match the configured default. Drag behavior still uses snap interval.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-03-21 11:05:15 +01:00
parent b51f18a910
commit c3927c85f8

View file

@ -3,7 +3,10 @@
* Handles click-and-drag on the calendar grid to create new events
*/
import { SNAP_INTERVAL_MINUTES } from '$lib/utils/calendarConstants';
import {
SNAP_INTERVAL_MINUTES,
DEFAULT_EVENT_DURATION_MINUTES,
} from '$lib/utils/calendarConstants';
export interface DragToCreateConfig {
containerEl: HTMLElement | null;
@ -95,7 +98,7 @@ export function useDragToCreate(getConfig: () => DragToCreateConfig) {
hasMoved = false;
createTargetDay = day;
createStartMinutes = snappedMinutes;
createEndMinutes = snappedMinutes + snap;
createEndMinutes = snappedMinutes + DEFAULT_EVENT_DURATION_MINUTES;
updatePreview();