Complete drag-to-create event functionality with proper timezone handling

Integrate drag-to-create functionality with the full event creation pipeline:

- Connect WeekView drag events to CreateEventModal via callback chain
- Add event creation request callback through Calendar → RouteHandler → App
- Implement proper timezone conversion throughout the entire flow
- Fix pixels_to_time calculation (1px = 1 minute, not complex formula)
- Add initial_start_time/initial_end_time props to CreateEventModal
- Convert local times to UTC in both event creation and update functions
- Ensure modal displays correct local times while backend receives UTC
- Support both temporary drag events and real server events in modal

The complete flow now works: drag selection → modal with correct times →
proper UTC conversion → backend storage → correct display in calendar.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Connor Johnstone
2025-08-29 11:33:14 -04:00
parent 53815c4814
commit 1c0140292f
5 changed files with 120 additions and 18 deletions

View File

@@ -397,7 +397,8 @@ fn snap_to_15_minutes(pixels: f64) -> f64 {
// Convert pixel position to time (inverse of time to pixels)
fn pixels_to_time(pixels: f64) -> NaiveTime {
let total_minutes = (pixels / 60.0) * 60.0; // 60px per hour, 60 minutes per hour
// Since 60px = 1 hour, pixels directly represent minutes
let total_minutes = pixels; // 1px = 1 minute
let hours = (total_minutes / 60.0) as u32;
let minutes = (total_minutes % 60.0) as u32;