feat: Split datetime fields
- Replace single datetime-local field with 4 separate fields: - Add helper functions: * splitDateTime(): Split datetime string into date and time parts * combineDateTime(): Combine date and time into datetime string - Implement internal state management: * startDate, startTime, endDate, endTime internal states * Sync effects to update internal states from start/end props * Change handlers for each field that combine values and call parent handlers - Fix test cases: * Update EventModal.test.tsx, EventUpdateModal.test.tsx to use new field labels * Change from 'Start'/'End' to 'Start Date'/'Start Time'/'End Time'/'End Date'
This commit is contained in:
committed by
Benoit TELLIER
parent
4f5308fe08
commit
701f2f2b71
@@ -201,6 +201,11 @@ function EventPopover({
|
||||
}
|
||||
|
||||
if (selectedRange && selectedRange.start && selectedRange.end) {
|
||||
// Auto-check allday if selectedRange is all-day
|
||||
if (selectedRange.allDay) {
|
||||
setAllDay(true);
|
||||
}
|
||||
|
||||
// selectedRange gives us the visual time displayed on calendar
|
||||
// Use selectedRange.startStr and endStr if available (from FullCalendar)
|
||||
if (selectedRange.startStr && selectedRange.endStr) {
|
||||
@@ -249,6 +254,9 @@ function EventPopover({
|
||||
|
||||
if (formattedStart) setStart(formattedStart);
|
||||
if (formattedEnd) setEnd(formattedEnd);
|
||||
|
||||
// Default to non-all-day when no selectedRange
|
||||
setAllDay(false);
|
||||
}
|
||||
|
||||
shouldSyncFromRangeRef.current = false;
|
||||
|
||||
Reference in New Issue
Block a user