fix initial calendar loading;
show unpublished events in calendar for ADMINS mark unavailable publishers when they are available on another time on the same day;
This commit is contained in:
@ -173,6 +173,9 @@ function ShiftComponent({ shift, onShiftSelect, isSelected, onPublisherSelect, a
|
||||
borderStyles += 'border-l-2 border-blue-500 '; // Left border for specific availability conditions
|
||||
ass.canTransport = av.isWithTransportIn || av.isWithTransportOut;
|
||||
}
|
||||
else {
|
||||
borderStyles += 'border-l-4 border-red-500 ';
|
||||
}
|
||||
|
||||
if (publisherInfo.hasUpToDateAvailabilities) {
|
||||
//add green right border
|
||||
|
@ -74,7 +74,10 @@ const AvCalendar = ({ publisherId, events, selectedDate, cartEvents }) => {
|
||||
return ce;
|
||||
}
|
||||
|
||||
useEffect(() => { setCartEvent(getCartEvent(date)); },
|
||||
useEffect(() => {
|
||||
//console.log("useEffect: ", date, selectedEvents, cartEvents);
|
||||
setCartEvent(getCartEvent(date));
|
||||
},
|
||||
[date, selectedEvents]);
|
||||
|
||||
// Update internal state when `events` prop changes
|
||||
@ -236,7 +239,9 @@ const AvCalendar = ({ publisherId, events, selectedDate, cartEvents }) => {
|
||||
console.log("handleSelect: ", existingEvents);
|
||||
|
||||
// Use the updated startdate for getCartEvent and ensure it reflects in the state properly
|
||||
setCartEvent(getCartEvent(startdate));
|
||||
const cartEvent = getCartEvent(startdate);
|
||||
setCartEvent(cartEvent);
|
||||
console.log("cartEvent: ", cartEvent.dayofweek);
|
||||
setSelectedEvents(existingEvents);
|
||||
setIsModalOpen(true);
|
||||
};
|
||||
|
Reference in New Issue
Block a user