diff --git a/components/calendar/avcalendar.tsx b/components/calendar/avcalendar.tsx index 88c01f7..8023ebd 100644 --- a/components/calendar/avcalendar.tsx +++ b/components/calendar/avcalendar.tsx @@ -261,7 +261,9 @@ const AvCalendar = ({ publisherId, events, selectedDate, cartEvents, lastPublish const enddate = common.setTimezone(end); if (!start || !end) return; - //readonly for past dates (ToDo: if not admin) + //readonly for past dates (ToDo: if not admin or current user) + const isCurrentUser = selectedEvents.some(event => event.userId === currentUserId); + if (!isAdmin && !isCurrentUser) { if (startdate < new Date() || end < new Date() || startdate > end) return; //or if schedule is published (lastPublishedDate)