0

I am working with a fullcalendar and the idea is: When I click on a day, it is saved in the database. After It must load the calendar with the saved selections and according to of certain conditions It must allow the selection or unselection of the days. My problem begin: when I select one day or multiple days and then I select another day, I lose the previous selection and I must keep it, as well as according to certain conditions enable or not a day to be selected or unselected. I am using version 5.3.2.I tried solutions of other questions but I suppose because of the version they do not work I would appreciate any suggestions. This is my code:

    document.addEventListener('DOMContentLoaded', function() {
          var calendarEl = document.getElementById('calendar');

          var calendar = new FullCalendar.Calendar(calendarEl, {
            selectable: true,   
            unselectAuto: false,
            headerToolbar: {
              left: 'title',
              right: 'prev,next',
            },
            dateClick: function(info) {
                $(".fc-highlight").css("background", "green");
            },
            select: function(info) {
              $(".fc-highlight").css("background", "green");
            }
          });

          calendar.render();
    });
Developer
  • 1
  • 4
  • dateClick can only handle clicking one day at a time. So if you use that approach you will need to save the selection each day separately, immediately as it's selected. – ADyson Oct 05 '20 at 11:16
  • select can handle selection of multiple days if you drag, but there cannot be any gaps in them. So again, immediately after the user selects any given area, you must save the selection, before they select anything else. – ADyson Oct 05 '20 at 11:17

0 Answers0