You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add drag & drop, resize, and month timed event styling
- Add enableDragDrop option for moving events (preserves duration)
- Add enableResize option for changing event duration
- Horizontal resize for all-day events (drag right edge)
- Vertical resize for timed events (drag bottom edge)
- Add monthTimedEventStyle option ('list' or 'block')
- List style shows dot + time + title in month view
- Block style shows traditional colored background
- Add snap-to-grid with live time feedback during drag
- Add click suppression after drag operations
- Add grab offset tracking for precise drag positioning
- Add CSS variable --cal-loading-bg for loading overlay
- Fix dark theme loading spinner background
- Update documentation with new features and CSS variables
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
-**Visual Indicator**: Small horizontal line appears at the bottom when hovering
495
+
-**How It Works**: Drag the bottom edge to change the end time
496
+
-**Available In**: Week/day timed sections
497
+
-**Snap to Grid**: 15-minute intervals
498
+
-**Minimum**: 15 minutes
499
+
-**Live Feedback**: Time display updates to show start and end times as you drag
500
+
501
+
### Callback Parameters
502
+
503
+
The `onEventDrop` callback receives the same parameters for both move and resize operations:
504
+
505
+
| Parameter | Type | Description |
506
+
|-----------|------|-------------|
507
+
|`event`| Object | The updated event object (with new start/end) |
508
+
|`oldStart`| Date | Original start date/time |
509
+
|`oldEnd`| Date | Original end date/time |
510
+
|`newStart`| Date | New start date/time |
511
+
|`newEnd`| Date | New end date/time |
512
+
513
+
**Detecting Operation Type:**
514
+
-**Move**: `oldStart !== newStart`
515
+
-**Resize**: `oldStart === newStart` and `oldEnd !== newEnd`
516
+
517
+
### Important Notes
518
+
519
+
- The calendar updates the event internally before firing the callback
520
+
- You **must** update your backend in the `onEventDrop` callback
521
+
- If the backend update fails, call `calendar.refresh()` to revert to the previous state
522
+
- Both features are disabled in list view (read-only)
523
+
- You can enable one, both, or neither feature independently
524
+
525
+
## Month View Timed Event Display Style
526
+
527
+
The `monthTimedEventStyle` option controls how timed events are displayed in month view:
528
+
529
+
### List Style (Default: `'list'`)
530
+
Schedule-style display with horizontal layout:
531
+
-**Colored dot**: Shows event color as a small circle
532
+
-**Time**: Displays start time (if `showTimeInItems` is enabled)
533
+
-**Title**: Event title truncated with ellipsis if too long
534
+
-**Compact**: Clean, minimal appearance similar to schedule apps
535
+
536
+
```javascript
537
+
constcalendar=newSimpleCalendarJs('#calendar', {
538
+
monthTimedEventStyle:'list', // Default
539
+
showTimeInItems:true// Shows time next to dot
540
+
});
541
+
```
542
+
543
+
### Block Style (`'block'`)
544
+
Traditional calendar block display:
545
+
-**Colored Background**: Full event background in event color
546
+
-**Time Display**: Start time shown inside block (if enabled)
547
+
-**Classic Look**: Traditional calendar appearance
548
+
549
+
```javascript
550
+
constcalendar=newSimpleCalendarJs('#calendar', {
551
+
monthTimedEventStyle:'block'
552
+
});
553
+
```
554
+
555
+
**Note**: This option only affects timed events in month view. All-day events always display as blocks, and week/day views always use block style with duration-based heights.
556
+
417
557
## API Methods
418
558
419
559
```javascript
@@ -870,6 +1010,9 @@ Example with a complete brand color scheme:
0 commit comments