diff --git a/smash/web/static/js/daily_planning.js b/smash/web/static/js/daily_planning.js index 028a91b11ed54637fc020c1f37bd6b0ed014f6d6..5590873bfeac20950ad4fdf1225956de389d8bb0 100644 --- a/smash/web/static/js/daily_planning.js +++ b/smash/web/static/js/daily_planning.js @@ -311,6 +311,13 @@ function saveEvents(calendar_selector) { }); } +function is_event_not_finished(event){ + if( event.status == undefined || event.status == 'SCHEDULED' ){ + return true; + }else{ + return false; + } +} function addDailyPlanningCalendar(calendar_selector, replace_all, calendar_dict_props){ @@ -342,7 +349,9 @@ function addDailyPlanningCalendar(calendar_selector, replace_all, calendar_dict_ click: function () { calendarEvents = $(calendar_selector).fullCalendar('clientEvents'); $.each(calendarEvents, function (i, calendar_event) { - remove_event(calendar_event); + if(is_event_not_finished(calendar_event)){ //do not delete finished events + remove_event(calendar_event); + } }); } },