diff --git a/components/calendar/avcalendar.tsx b/components/calendar/avcalendar.tsx index 647ce69..b175a13 100644 --- a/components/calendar/avcalendar.tsx +++ b/components/calendar/avcalendar.tsx @@ -305,22 +305,22 @@ const AvCalendar = ({ publisherId, events, selectedDate }) => { } - if (event.isActive) { - switch (event.type) { - case 'assignment': - // backgroundColor = '#48bb78' // always green-500 as we don't pass isConfirmed correctly - //backgroundColor = event.isConfirmed ? '#48bb78' : '#f6e05e'; // green-500 and yellow-300 from Tailwind CSS - break; - case 'recurring': - backgroundColor = '#63b3ed'; // blue-300 from Tailwind CSS - break; - default: // availability - //backgroundColor = '#a0aec0'; // gray-400 from Tailwind CSS - break; - } - } else { - backgroundColor = '#a0aec0'; // Default color for inactive events + // if (event.isActive) { + switch (event.type) { + case 'assignment': + // backgroundColor = '#48bb78' // always green-500 as we don't pass isConfirmed correctly + //backgroundColor = event.isConfirmed ? '#48bb78' : '#f6e05e'; // green-500 and yellow-300 from Tailwind CSS + break; + case 'recurring': + backgroundColor = '#63b3ed'; // blue-300 from Tailwind CSS + break; + default: // availability + //backgroundColor = '#a0aec0'; // gray-400 from Tailwind CSS + break; } + // } else { + // backgroundColor = '#a0aec0'; // Default color for inactive events + // } return { style: { @@ -343,16 +343,14 @@ const AvCalendar = ({ publisherId, events, selectedDate }) => { const handleMouseLeave = () => setIsHovered(false); if (currentView !== 'agenda') { //if event.type is availability show in blue. if it is schedule - green if confirmed, yellow if not confirmed - //if event is not active - show in gray - let bgColorClass = 'bg-gray-500'; // Default color for inactive events - var bgColor = event.isActive ? "" : "bg-gray-500"; + var bgColor = ""; //ToDo: fix this. maybe we're missing some properties // if (event.isFromPreviousMonth) { // // set opacity to 0.5 // bgColor = "bg-orange-500"; // } if (event.type === "assignment") { - bgColor = event.isBySystem ? "bg-red-500" : (event.isConfirmed || true ? "bg-green-500" : "bg-yellow-500"); + // bgColor = event.isBySystem ? "bg-red-500" : (event.isConfirmed || true ? "bg-green-500" : "bg-yellow-500"); //event.title = event.publisher.name; //ToDo: add other publishers names //event.title = common.getTimeFomatted(event.startTime) + " - " + common.getTimeFomatted(event.endTime); @@ -360,7 +358,6 @@ const AvCalendar = ({ publisherId, events, selectedDate }) => { if (event.start !== undefined && event.end !== undefined && event.startTime !== null && event.endTime !== null) { try { if (event.type === "recurring") { - //bgColor = "bg-blue-300"; event.title = common.getTimeFomatted(event.startTime) + " - " + common.getTimeFomatted(event.endTime); } else { diff --git a/pages/api/index.ts b/pages/api/index.ts index 7906790..adc1129 100644 --- a/pages/api/index.ts +++ b/pages/api/index.ts @@ -826,7 +826,9 @@ async function getCalendarEvents(publisherId, date, availabilities = true, assig startTime: true, endTime: true, name: true, - isFromPreviousAssignment: true + isFromPreviousAssignment: true, + isFromPreviousMonth: true, + repeatWeekly: true, } }, assignments: {