let jquery_datatable = $("#table1").DataTable();

//calender
document.addEventListener('DOMContentLoaded', function() {
    var calendarEl = document.getElementById('calendar');
    var calendar = new FullCalendar.Calendar(calendarEl, {
        initialView: 'dayGridMonth'
    });
    calendar.render();
});


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

    //var eventsphp = <?php if(array_key_exists('events',get_defined_vars())){ echo json_encode(array("events" => $events)); }else{ echo '{}'; }?>;
    if (Object.values(eventsphp).length != 0) {


        var values = Object.values(eventsphp)[0];
        console.log(Object.values(eventsphp));
        for (var i = 0; i < values.length; i++) {
            eventsData.push({ title: values[i]["event_count"], date: values[i]["date"] })
        }

        var calendar = new FullCalendar.Calendar(calendarEl, {
            initialView: 'dayGridMonth',
            events: eventsData

        });

        calendar.render();
    }
});