correctly assume if assignmen is old, new database fields suggestions
This commit is contained in:
@ -735,7 +735,11 @@ export default function CalendarPage({ initialEvents, initialShifts }) {
|
||||
console.log("dayShifts:", dayShifts);
|
||||
|
||||
const hasAssignment = (shiftId) => {
|
||||
return publisher.assignments.some(ass => ass.shift.id === shiftId);
|
||||
// return publisher.assignments.some(ass => ass.shift.id == shiftId);
|
||||
return publisher.assignments.some(ass => {
|
||||
console.log(`Comparing: ${ass.shift.id} to ${shiftId}: ${ass.shift.id === shiftId}`);
|
||||
return ass.shift.id === shiftId;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@ -780,9 +784,9 @@ export default function CalendarPage({ initialEvents, initialShifts }) {
|
||||
return (
|
||||
<div
|
||||
key={index}
|
||||
className={`text-sm text-white p-2 rounded-md ${isFromPrevMonth ? 'border-l-4 border-yellow-500' : ''} ${assignmentExists ? 'bg-blue-200' : shift.color} h-24 flex flex-col justify-center`}
|
||||
className={`text-sm text-white p-2 rounded-md ${isFromPrevMonth ? 'border-l-6 border-black-500' : ''} ${assignmentExists ? 'bg-blue-200' : shift.color} h-24 flex flex-col justify-center`}
|
||||
>
|
||||
{common.getTimeRange(shift.startTime, shift.endTime)}
|
||||
{common.getTimeRange(shift.startTime, shift.endTime)} {shift.id}
|
||||
|
||||
{!assignmentExists && shift.isAvailable && (
|
||||
<button onClick={() => { addAssignment(publisher, shift.id); onClose() }}
|
||||
|
Reference in New Issue
Block a user