+function($){ "use strict"; $('.external-event').each(function(){ $(this).data('event', { title: $.trim($(this).text()), className: [$(this).data('class')] }); }); $('.external-event').draggable({ revert: true, revertDuration: 0 }); var cal = $('#fullcalendar').fullCalendar({ theme: true, editable: false, droppable: false, header: { left: 'prev, today, next', center: 'title' }, buttonText: { prev: '', next: '' }, events: [ { "category": "online", "title": "Online: 01 h 39 min", "start": "2024-04-25", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 00 min", "start": "2024-04-26", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 39 min", "start": "2024-04-27", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 12 min", "start": "2024-04-28", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 48 min", "start": "2024-05-01", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 06 min", "start": "2024-05-03", "className": ["success"] }, { "category": "online", "title": "Online: 03 h 15 min", "start": "2024-09-10", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 24 min", "start": "2024-09-11", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 51 min", "start": "2024-09-12", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 33 min", "start": "2024-09-16", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 45 min", "start": "2024-09-17", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 57 min", "start": "2024-09-18", "className": ["success"] }, { "category": "online", "title": "Online: 05 h 03 min", "start": "2024-09-19", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 57 min", "start": "2024-09-23", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 06 min", "start": "2024-09-24", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 39 min", "start": "2024-09-25", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 09 min", "start": "2024-10-01", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 51 min", "start": "2024-10-03", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 45 min", "start": "2024-10-10", "className": ["success"] }, { "category": "online", "title": "Online: 03 h 15 min", "start": "2024-10-15", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 42 min", "start": "2024-10-24", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 54 min", "start": "2024-10-25", "className": ["success"] }, { "category": "online", "title": "Online: 03 h 21 min", "start": "2024-10-28", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 48 min", "start": "2024-10-31", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 27 min", "start": "2024-11-01", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 39 min", "start": "2024-11-02", "className": ["success"] }, { "category": "online", "title": "Online: 05 h 21 min", "start": "2024-11-15", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 54 min", "start": "2024-11-16", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 57 min", "start": "2024-11-17", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 30 min", "start": "2024-11-19", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 09 min", "start": "2024-11-21", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 39 min", "start": "2024-11-26", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 54 min", "start": "2024-11-27", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 06 min", "start": "2024-11-28", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 30 min", "start": "2024-11-29", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 18 min", "start": "2024-11-30", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 09 min", "start": "2024-12-01", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 00 min", "start": "2024-12-03", "className": ["success"] }, { "category": "online", "title": "Online: 03 h 06 min", "start": "2024-12-04", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 54 min", "start": "2024-12-05", "className": ["success"] }, { "category": "online", "title": "Online: 04 h 09 min", "start": "2024-12-09", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 06 min", "start": "2024-12-10", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 00 min", "start": "2024-12-11", "className": ["success"] }, { "category": "online", "title": "Online: 05 h 12 min", "start": "2024-12-23", "className": ["success"] }, { "category": "online", "title": "Online: 03 h 18 min", "start": "2025-01-11", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 51 min", "start": "2025-01-12", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 12 min", "start": "2025-01-14", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 00 min", "start": "2025-01-16", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 57 min", "start": "2025-01-17", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 39 min", "start": "2025-01-18", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 21 min", "start": "2025-01-21", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 00 min", "start": "2025-01-25", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 06 min", "start": "2025-01-26", "className": ["success"] }, { "category": "online", "title": "Online: 04 h 33 min", "start": "2025-01-27", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 57 min", "start": "2025-01-28", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 33 min", "start": "2025-01-30", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 03 min", "start": "2025-01-31", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 21 min", "start": "2025-02-01", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 39 min", "start": "2025-02-02", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 24 min", "start": "2025-02-13", "className": ["success"] }, { "category": "online", "title": "Online: 03 h 00 min", "start": "2025-02-14", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 06 min", "start": "2025-02-17", "className": ["success"] }, { "category": "online", "title": "Online: 02 h 45 min", "start": "2025-02-18", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 06 min", "start": "2025-02-19", "className": ["success"] }, { "category": "online", "title": "Online: 01 h 48 min", "start": "2025-02-22", "className": ["success"] }, { "category": "online", "title": "Online: 00 h 54 min", "start": "2025-02-27", "className": ["success"] }, { "category": "Score", "title": "Max score: 393", "start": "2024-04-25", "className": ["primary"] }, { "category": "Score", "title": "Max score: 502", "start": "2024-04-26", "className": ["primary"] }, { "category": "Score", "title": "Max score: 388", "start": "2024-04-27", "className": ["primary"] }, { "category": "Score", "title": "Max score: 292", "start": "2024-04-28", "className": ["primary"] }, { "category": "Score", "title": "Max score: 757", "start": "2024-05-01", "className": ["primary"] }, { "category": "Score", "title": "Max score: 998", "start": "2024-05-03", "className": ["primary"] }, { "category": "Score", "title": "Max score: 597", "start": "2024-09-10", "className": ["primary"] }, { "category": "Score", "title": "Max score: 432", "start": "2024-09-11", "className": ["primary"] }, { "category": "Score", "title": "Max score: 396", "start": "2024-09-12", "className": ["primary"] }, { "category": "Score", "title": "Max score: 276", "start": "2024-09-16", "className": ["primary"] }, { "category": "Score", "title": "Max score: 480", "start": "2024-09-17", "className": ["primary"] }, { "category": "Score", "title": "Max score: 222", "start": "2024-09-18", "className": ["primary"] }, { "category": "Score", "title": "Max score: 415", "start": "2024-09-19", "className": ["primary"] }, { "category": "Score", "title": "Max score: 236", "start": "2024-09-23", "className": ["primary"] }, { "category": "Score", "title": "Max score: 348", "start": "2024-09-24", "className": ["primary"] }, { "category": "Score", "title": "Max score: 383", "start": "2024-09-25", "className": ["primary"] }, { "category": "Score", "title": "Max score: 294", "start": "2024-10-01", "className": ["primary"] }, { "category": "Score", "title": "Max score: 444", "start": "2024-10-03", "className": ["primary"] }, { "category": "Score", "title": "Max score: 525", "start": "2024-10-10", "className": ["primary"] }, { "category": "Score", "title": "Max score: 1084", "start": "2024-10-15", "className": ["primary"] }, { "category": "Score", "title": "Max score: 509", "start": "2024-10-24", "className": ["primary"] }, { "category": "Score", "title": "Max score: 639", "start": "2024-10-25", "className": ["primary"] }, { "category": "Score", "title": "Max score: 832", "start": "2024-10-28", "className": ["primary"] }, { "category": "Score", "title": "Max score: 712", "start": "2024-10-31", "className": ["primary"] }, { "category": "Score", "title": "Max score: 600", "start": "2024-11-01", "className": ["primary"] }, { "category": "Score", "title": "Max score: 675", "start": "2024-11-02", "className": ["primary"] }, { "category": "Score", "title": "Max score: 794", "start": "2024-11-15", "className": ["primary"] }, { "category": "Score", "title": "Max score: 508", "start": "2024-11-16", "className": ["primary"] }, { "category": "Score", "title": "Max score: 734", "start": "2024-11-17", "className": ["primary"] }, { "category": "Score", "title": "Max score: 1061", "start": "2024-11-19", "className": ["primary"] }, { "category": "Score", "title": "Max score: 828", "start": "2024-11-21", "className": ["primary"] }, { "category": "Score", "title": "Max score: 1012", "start": "2024-11-26", "className": ["primary"] }, { "category": "Score", "title": "Max score: 721", "start": "2024-11-27", "className": ["primary"] }, { "category": "Score", "title": "Max score: 408", "start": "2024-11-28", "className": ["primary"] }, { "category": "Score", "title": "Max score: 681", "start": "2024-11-29", "className": ["primary"] }, { "category": "Score", "title": "Max score: 775", "start": "2024-11-30", "className": ["primary"] }, { "category": "Score", "title": "Max score: 872", "start": "2024-12-01", "className": ["primary"] }, { "category": "Score", "title": "Max score: 719", "start": "2024-12-03", "className": ["primary"] }, { "category": "Score", "title": "Max score: 816", "start": "2024-12-04", "className": ["primary"] }, { "category": "Score", "title": "Max score: 844", "start": "2024-12-05", "className": ["primary"] }, { "category": "Score", "title": "Max score: 997", "start": "2024-12-09", "className": ["primary"] }, { "category": "Score", "title": "Max score: 1257", "start": "2024-12-10", "className": ["primary"] }, { "category": "Score", "title": "Max score: 1148", "start": "2024-12-11", "className": ["primary"] }, { "category": "Score", "title": "Max score: 1580", "start": "2024-12-23", "className": ["primary"] }, { "category": "Score", "title": "Max score: 1083", "start": "2025-01-11", "className": ["primary"] }, { "category": "Score", "title": "Max score: 1716", "start": "2025-01-12", "className": ["primary"] }, { "category": "Score", "title": "Max score: 2904", "start": "2025-01-14", "className": ["primary"] }, { "category": "Score", "title": "Max score: 783", "start": "2025-01-16", "className": ["primary"] }, { "category": "Score", "title": "Max score: 1036", "start": "2025-01-17", "className": ["primary"] }, { "category": "Score", "title": "Max score: 2567", "start": "2025-01-18", "className": ["primary"] }, { "category": "Score", "title": "Max score: 2579", "start": "2025-01-21", "className": ["primary"] }, { "category": "Score", "title": "Max score: 1761", "start": "2025-01-25", "className": ["primary"] }, { "category": "Score", "title": "Max score: 345", "start": "2025-01-26", "className": ["primary"] }, { "category": "Score", "title": "Max score: 2955", "start": "2025-01-27", "className": ["primary"] }, { "category": "Score", "title": "Max score: 2158", "start": "2025-01-28", "className": ["primary"] }, { "category": "Score", "title": "Max score: 3211", "start": "2025-01-30", "className": ["primary"] }, { "category": "Score", "title": "Max score: 221", "start": "2025-01-31", "className": ["primary"] }, { "category": "Score", "title": "Max score: 651", "start": "2025-02-01", "className": ["primary"] }, { "category": "Score", "title": "Max score: 837", "start": "2025-02-02", "className": ["primary"] }, { "category": "Score", "title": "Max score: 6671", "start": "2025-02-13", "className": ["primary"] }, { "category": "Score", "title": "Max score: 6467", "start": "2025-02-14", "className": ["primary"] }, { "category": "Score", "title": "Max score: 4961", "start": "2025-02-17", "className": ["primary"] }, { "category": "Score", "title": "Max score: 2281", "start": "2025-02-18", "className": ["primary"] }, { "category": "Score", "title": "Max score: 1727", "start": "2025-02-19", "className": ["primary"] }, { "category": "Score", "title": "Max score: 6684", "start": "2025-02-22", "className": ["primary"] }, { "category": "Score", "title": "Max score: 1870", "start": "2025-02-27", "className": ["primary"] }, { "category": "likes", "title": "New Likes: 495", "start": "2024-04-26", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 365", "start": "2024-04-27", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 68", "start": "2024-04-28", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 896", "start": "2024-05-01", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 2132", "start": "2024-05-03", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 32221", "start": "2024-09-10", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 965", "start": "2024-09-11", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 531", "start": "2024-09-12", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 324", "start": "2024-09-16", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 1913", "start": "2024-09-17", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 230", "start": "2024-09-18", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 1429", "start": "2024-09-19", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 288", "start": "2024-09-23", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 416", "start": "2024-09-24", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 435", "start": "2024-09-25", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 488", "start": "2024-10-01", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 178", "start": "2024-10-03", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 774", "start": "2024-10-10", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 2881", "start": "2024-10-15", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 319", "start": "2024-10-24", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 814", "start": "2024-10-25", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 1213", "start": "2024-10-28", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 605", "start": "2024-10-31", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 343", "start": "2024-11-01", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 405", "start": "2024-11-02", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 1592", "start": "2024-11-15", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 419", "start": "2024-11-16", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 841", "start": "2024-11-17", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 1497", "start": "2024-11-19", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 484", "start": "2024-11-21", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 1603", "start": "2024-11-26", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 988", "start": "2024-11-27", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 103", "start": "2024-11-28", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 396", "start": "2024-11-29", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 684", "start": "2024-11-30", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 409", "start": "2024-12-01", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 830", "start": "2024-12-03", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 1567", "start": "2024-12-04", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 271", "start": "2024-12-05", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 2288", "start": "2024-12-09", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 277", "start": "2024-12-10", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 456", "start": "2024-12-11", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 6495", "start": "2024-12-23", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 2657", "start": "2025-01-11", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 1315", "start": "2025-01-12", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 2370", "start": "2025-01-14", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 1048", "start": "2025-01-16", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 2076", "start": "2025-01-17", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 1478", "start": "2025-01-18", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 2079", "start": "2025-01-21", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 1233", "start": "2025-01-25", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 116", "start": "2025-01-26", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 4198", "start": "2025-01-27", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 1873", "start": "2025-01-28", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 1103", "start": "2025-01-30", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 82", "start": "2025-01-31", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 533", "start": "2025-02-01", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 646", "start": "2025-02-02", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 709", "start": "2025-02-13", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 1297", "start": "2025-02-14", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 1046", "start": "2025-02-17", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 2206", "start": "2025-02-18", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 620", "start": "2025-02-19", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 1452", "start": "2025-02-22", "className": ["purple"] }, { "category": "likes", "title": "New Likes: 596", "start": "2025-02-27", "className": ["purple"] } ], drop: function(date) { if ($('#drop-remove').is(':checked')) { $(this).remove(); } }, dayClick: function(date, jsEvent, view) { var modal = $('#new_event_modal'); modal.modal('show'); modal.find('#event_start').val(date.format()); } }); $.fn.windowCheck = function() { var ww = $(window).width(); if(ww > 768) { cal.fullCalendar('changeView', 'month'); } else if(ww < 768 && ww > 540) { cal.fullCalendar('changeView', 'basicWeek'); } else { cal.fullCalendar('changeView', 'basicDay'); } }; $(window).on('resize', function(e){ $().windowCheck(); }); $('.fc-prev-button').append(''); $('.fc-next-button').append(''); // add new event category $('#new_event_cat_form').on('submit', function(e){ e.preventDefault(); var name = $(this).find('#category_name').val(); var color = $(this).find('#category_color').val(); var category = $('
'); category.text(name); category.addClass(color); category.data('event', { title: name, className: [color] }); category.draggable({ revert: true, revertDuration: 0 }); $('#external-events').append(category); $('#new_event_cat_modal').modal('hide'); }); // add new event $('#new_event_form').on('submit', function(e){ e.preventDefault(); var title = $(this).find('#event_title').val(); var category = $(this).find('#event_category').val(); var start = $(this).find('#event_start').val(); cal.fullCalendar('addEventSource', [ { title: title, start: start, className: [category] } ]) $('#new_event_modal').modal('hide'); }); }(jQuery);