background-events.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8' />
  5. <script src='../dist/index.global.js'></script>
  6. <script>
  7. document.addEventListener('DOMContentLoaded', function() {
  8. var calendarEl = document.getElementById('calendar');
  9. var calendar = new FullCalendar.Calendar(calendarEl, {
  10. headerToolbar: {
  11. left: 'prev,next today',
  12. center: 'title',
  13. right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth'
  14. },
  15. initialDate: '2023-01-12',
  16. navLinks: true, // can click day/week names to navigate views
  17. businessHours: true, // display business hours
  18. editable: true,
  19. selectable: true,
  20. events: [
  21. {
  22. title: 'Business Lunch',
  23. start: '2023-01-03T13:00:00',
  24. constraint: 'businessHours'
  25. },
  26. {
  27. title: 'Meeting',
  28. start: '2023-01-13T11:00:00',
  29. constraint: 'availableForMeeting', // defined below
  30. color: '#257e4a'
  31. },
  32. {
  33. title: 'Conference',
  34. start: '2023-01-18',
  35. end: '2023-01-20'
  36. },
  37. {
  38. title: 'Party',
  39. start: '2023-01-29T20:00:00'
  40. },
  41. // areas where "Meeting" must be dropped
  42. {
  43. groupId: 'availableForMeeting',
  44. start: '2023-01-11T10:00:00',
  45. end: '2023-01-11T16:00:00',
  46. display: 'background'
  47. },
  48. {
  49. groupId: 'availableForMeeting',
  50. start: '2023-01-13T10:00:00',
  51. end: '2023-01-13T16:00:00',
  52. display: 'background'
  53. },
  54. // red areas where no events can be dropped
  55. {
  56. start: '2023-01-24',
  57. end: '2023-01-28',
  58. overlap: false,
  59. display: 'background',
  60. color: '#ff9f89'
  61. },
  62. {
  63. start: '2023-01-06',
  64. end: '2023-01-08',
  65. overlap: false,
  66. display: 'background',
  67. color: '#ff9f89'
  68. }
  69. ]
  70. });
  71. calendar.render();
  72. });
  73. </script>
  74. <style>
  75. body {
  76. margin: 40px 10px;
  77. padding: 0;
  78. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  79. font-size: 14px;
  80. }
  81. #calendar {
  82. max-width: 1100px;
  83. margin: 0 auto;
  84. }
  85. </style>
  86. </head>
  87. <body>
  88. <div id='calendar'></div>
  89. </body>
  90. </html>