Final JavaScript to populate and show the modal on click of an event

document.addEventListener('DOMContentLoaded', function() {
    var calendarEl = document.getElementById('calendar');
    var calendar = new FullCalendar.Calendar(calendarEl, {
        initialView: 'dayGridMonth',
        nextDayThreshold: '06:30:00',
        timeZone: 'Europe/London',
        eventClick: function(info) {
            var dateSettings = { "year": "numeric", "month": "2-digit", "day": "2-digit" };
            var timeSettings = { "hour": "2-digit", "minute": "2-digit", "hour12": false };

            var startdate = calendar.formatDate(info.event.start,  dateSettings);
            var starttime = calendar.formatDate(info.event.start,  timeSettings);

            var enddate; 
            var endtime; 
            if (info.event.end != null) {
              enddate = calendar.formatDate(info.event.end, timeSettings );
              endtime = calendar.formatDate(info.event.end, dateSettings );
            } 
            else {
              enddate = startdate;
              endtime = starttime;
            }

          $('.modal-title').html(info.event.title);
            $('[data-id="event-start-date"]').html(startdate);
            $('[data-id="event-start-time"]').html(starttime);
            $('[data-id="event-venue1"]').html(info.event.extendedProps.venue1);
            $('[data-id="event-venue2"]').html(info.event.extendedProps.venue2);
            $('[data-id="artist"]').html(info.event.extendedProps.artist);
            $('[data-id="tour"]').html(info.event.extendedProps.tour);
            $('[data-id="ticket-availability"]').html(info.event.extendedProps.ticket_availability);
            $('[data-id="buy-tickets"]').attr('href',info.event.extendedProps.purchase_url);
            var artwork = decodeURIComponent(info.event.extendedProps.artwork) + "&Full=true";
            $('[data-id="event-artwork"]').attr('src',artwork);
            $('#fullCalModal').modal();
        },
        events: {% include 'Concert Calendar' %},
        eventTimeFormat: {
          hour: 'numeric',
          minute: '2-digit',
          omitZeroMinute: true,
          meridiem: 'short'
        }
    });
    calendar.render();
    });
Franco Musso