mirror of
https://github.com/urosran/cally.git
synced 2025-07-09 22:57:16 +00:00
Calendar controls fix
This commit is contained in:
@ -29,16 +29,22 @@ export const useCalendarControls = (events: any[]) => {
|
||||
new Date(foundEvent.end)
|
||||
};
|
||||
|
||||
setEditVisible(true);
|
||||
setEventForEdit(processedEvent);
|
||||
if (processedEvent.startDate instanceof Date &&
|
||||
processedEvent.endDate instanceof Date &&
|
||||
!isNaN(processedEvent.startDate.getTime()) &&
|
||||
!isNaN(processedEvent.endDate.getTime())) {
|
||||
setEditVisible(true);
|
||||
setEventForEdit(processedEvent);
|
||||
}
|
||||
}
|
||||
}, [events, setEditVisible, setEventForEdit]);
|
||||
|
||||
|
||||
const handlePressCell = useCallback((date: DateOrDateTime) => {
|
||||
const selectedDate = new Date(date.dateTime!);
|
||||
const minutes = selectedDate.getMinutes();
|
||||
|
||||
selectedDate.setMinutes(minutes - (minutes % 30), 0, 0); // Also sets seconds and milliseconds to 0
|
||||
selectedDate.setMinutes(minutes - (minutes % 30), 0, 0);
|
||||
|
||||
setSelectedNewEndDate(selectedDate);
|
||||
}, [setSelectedNewEndDate]);
|
||||
|
Reference in New Issue
Block a user