import "../../../../../../../assets/js/full-calendar/v3/fullcalendar.min.js";
export function renderCalender(id, courseData, hoverOver) {
    let calendarAlert = document.getElementById(id + "-alert");
    if (calendarAlert) calendarAlert.remove();

    jQuery(document).ready(function () {
        jQuery('#' + id).fullCalendar({
            header: {
                right: 'today,prev,month,agendaWeek,next'
            },
            defaultView: 'month',
            firstDay: 1,
            minTime: '08:00',
            maxTime: '18:00',
            weekNumbers: false,
            buttonText: {
                today: 'vandaag',
                month: 'maand',
                week: 'week'
            },
            monthNames: ['Januari', 'Februari', 'Maart', 'April', 'Mei', 'Juni', 'Juli', 'Augustus', 'September', 'Oktober', 'November', 'December'],
            monthNamesShort: ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec'],
            dayNamesShort: ['Zon', 'Maa', 'Din', 'Woe', 'Don', 'Vrij', 'Zat'],
            dayNames: ['Zondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrijdag', 'Zaterdag'],
            timeFormat: 'HH:mm',
            axisFormat: 'HH:mm',
            weekends: true,
            events: courseData,
            eventMouseover: function (data, event, view) {
                let tooltip = '<div class="tooltiptopicevent">' + data.description + '</div>';

                jQuery("body").append(tooltip);
                jQuery(this).mouseover(function (e) {
                    if (hoverOver){
                        jQuery(this).css('z-index', 10000);
                        let element = jQuery('.tooltiptopicevent');
                        element.fadeIn('500');
                        element.fadeTo('10', 1.9);
                    }
                }).mousemove(function (e) {
                    if (hoverOver){
                        let element = jQuery('.tooltiptopicevent');
                        element.css('top', e.pageY + 10);
                        element.css('left', e.pageX + 20);
                    }
                });
            },
            eventMouseout: function (data, event, view) {
                if (hoverOver){
                    jQuery(this).css('z-index', 8);
                    jQuery('.tooltiptopicevent').remove();
                }
            }
        });
    });

}
