document.addEventListener('DOMContentLoaded', function() { var calendarEl = document.getElementById('calendar'); var calendar = new FullCalendar.Calendar(calendarEl, { plugins: [ 'interaction', 'dayGrid', 'timeGrid', 'list', 'googleCalendar' ], defaultView: 'listMonth', header: { // left: 'prev,next today', left: 'title', right: 'today,next,dayGridMonth,listMonth' // right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth' }, locale:'uk', selectable: true, unselectAuto: false, displayEventTime: true, // don't show the time column in list view weekNumbers: true, navLinks: false, // can click day/week names to navigate views businessHours: true, // display business hours editable: false, eventLimit: true, // allow "more" link when too many events fixedWeekCount: false, showNonCurrentDates: false, weekNumbers: true, weekNumbersWithinDays: true, weekNumberCalculation: 'ISO', // To make your own Google API key, follow the directions here: // http://fullcalendar.io/docs/google_calendar/ googleCalendarApiKey: 'AIzaSyDMlT0t6_CJD01LzlpokWmY00ZX4pE1cVE', eventSources: [ // { // googleCalendarId: 'uk.ukrainian#holiday@group.v.calendar.google.com', // color: '#3788d8' // }, /*{ googleCalendarId: '9tohp5u3uvs7339iln0ke2c0l4@group.calendar.google.com', color: '#20599c' }, { url: '/feeds.json' },*/ { events: events } ], // US Holidays //events: '9tohp5u3uvs7339iln0ke2c0l4@group.calendar.google.com', // '9tohp5u3uvs7339iln0ke2c0l4@group.calendar.google.com', eventClick: function(arg) { arg.el.style.backgroundColor = '#607d8b'; if (arg.event.url) { window.open(arg.event.url, 'google-calendar-event', 'width=700,height=600'); arg.jsEvent.preventDefault(); // don't navigate in main tab } else { $.ajax({ url: "calendar", type: "POST", data: {eventid: arg.event.id}, success: function(response) { $("#myModal .modal-body").html(response); $("#myModal .modal-title p").html(arg.event.title); $("#myModal .modal-startdate p").text(arg.event.startdate); $("#myModal").modal("show"); } }); } }, /* eventClick: function(arg) { // opens events in a popup window window.open(arg.event.url, 'google-calendar-event', 'width=700,height=600'); arg.jsEvent.preventDefault(); // don't navigate in main tab },*/ loading: function(bool) { document.getElementById('loading').style.display = bool ? 'block' : 'none'; } }); calendar.render(); if (window.screen.width < 670) { calendar.setOption('height', 495); } });