Skip to content

Commit c2824ec

Browse files
committed
Calendar can now only view and delete task
1 parent 275738d commit c2824ec

1 file changed

Lines changed: 18 additions & 17 deletions

File tree

frontend/src/components/calendar/calendar.jsx

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import dayGridPlugin from "@fullcalendar/daygrid";
55
import timeGridPlugin from "@fullcalendar/timegrid";
66
import interactionPlugin from "@fullcalendar/interaction";
77
import { getEvents, createEventId } from "./TaskDataHandler";
8+
import { axiosInstance } from "src/api/AxiosConfig";
89

910
export class Calendar extends React.Component {
1011
state = {
@@ -25,13 +26,13 @@ export class Calendar extends React.Component {
2526
right: "dayGridMonth,timeGridWeek,timeGridDay",
2627
}}
2728
initialView="dayGridMonth"
28-
editable={true}
29-
selectable={true}
29+
editable={false}
30+
selectable={false}
3031
selectMirror={true}
3132
dayMaxEvents={true}
3233
weekends={this.state.weekendsVisible}
3334
initialEvents={getEvents}
34-
select={this.handleDateSelect}
35+
// select={this.handleDateSelect}
3536
eventContent={renderEventContent}
3637
eventClick={this.handleEventClick}
3738
eventsSet={this.handleEvents}
@@ -85,22 +86,22 @@ export class Calendar extends React.Component {
8586
});
8687
};
8788

88-
handleDateSelect = (selectInfo) => {
89-
let title = prompt("Please enter a new title for your event");
90-
let calendarApi = selectInfo.view.calendar;
89+
// handleDateSelect = (selectInfo) => {
90+
// let title = prompt("Please enter a new title for your event");
91+
// let calendarApi = selectInfo.view.calendar;
9192

92-
calendarApi.unselect(); // clear date selection
93+
// calendarApi.unselect(); // clear date selection
9394

94-
if (title) {
95-
calendarApi.addEvent({
96-
id: createEventId(),
97-
title,
98-
start: selectInfo.startStr,
99-
end: selectInfo.endStr,
100-
allDay: selectInfo.allDay,
101-
});
102-
}
103-
};
95+
// if (title) {
96+
// calendarApi.addEvent({
97+
// id: createEventId(),
98+
// title,
99+
// start: selectInfo.startStr,
100+
// end: selectInfo.endStr,
101+
// allDay: selectInfo.allDay,
102+
// });
103+
// }
104+
// };
104105

105106
handleEventClick = (clickInfo) => {
106107
if (confirm(`Are you sure you want to delete the event '${clickInfo.event.title}'`)) {

0 commit comments

Comments
 (0)