timeline-no-interaction.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8' />
  5. <link href='../packages-premium/bundle/main.css' rel='stylesheet' />
  6. <script src='../packages-premium/bundle/main.js'></script>
  7. <script>
  8. document.addEventListener('DOMContentLoaded', function() {
  9. var calendarEl = document.getElementById('calendar');
  10. var calendar = new FullCalendar.Calendar(calendarEl, {
  11. now: '2020-09-07',
  12. aspectRatio: 1.8,
  13. scrollTime: '00:00',
  14. headerToolbar: {
  15. left: 'today prev,next',
  16. center: 'title',
  17. right: 'resourceTimelineDay,resourceTimelineThreeDays,timeGridWeek,dayGridMonth'
  18. },
  19. initialView: 'resourceTimelineDay',
  20. views: {
  21. resourceTimelineThreeDays: {
  22. type: 'resourceTimeline',
  23. duration: { days: 3 },
  24. buttonText: '3 days'
  25. }
  26. },
  27. resourceAreaWidth: '30%',
  28. resourceAreaColumns: [
  29. {
  30. headerContent: 'Room',
  31. field: 'title'
  32. },
  33. {
  34. headerContent: 'Occupancy',
  35. field: 'occupancy'
  36. }
  37. ],
  38. resources: [
  39. { id: 'a', title: 'Auditorium A', occupancy: 40 },
  40. { id: 'b', title: 'Auditorium B', occupancy: 40, eventColor: 'green' },
  41. { id: 'c', title: 'Auditorium C', occupancy: 40, eventColor: 'orange' },
  42. { id: 'd', title: 'Auditorium D', occupancy: 40, children: [
  43. { id: 'd1', title: 'Room D1', occupancy: 10 },
  44. { id: 'd2', title: 'Room D2', occupancy: 10 }
  45. ] },
  46. { id: 'e', title: 'Auditorium E', occupancy: 40 },
  47. { id: 'f', title: 'Auditorium F', occupancy: 40, eventColor: 'red' },
  48. { id: 'g', title: 'Auditorium G', occupancy: 40 },
  49. { id: 'h', title: 'Auditorium H', occupancy: 40 },
  50. { id: 'i', title: 'Auditorium I', occupancy: 40 },
  51. { id: 'j', title: 'Auditorium J', occupancy: 40 },
  52. { id: 'k', title: 'Auditorium K', occupancy: 40 },
  53. { id: 'l', title: 'Auditorium L', occupancy: 40 },
  54. { id: 'm', title: 'Auditorium M', occupancy: 40 },
  55. { id: 'n', title: 'Auditorium N', occupancy: 40 },
  56. { id: 'o', title: 'Auditorium O', occupancy: 40 },
  57. { id: 'p', title: 'Auditorium P', occupancy: 40 },
  58. { id: 'q', title: 'Auditorium Q', occupancy: 40 },
  59. { id: 'r', title: 'Auditorium R', occupancy: 40 },
  60. { id: 's', title: 'Auditorium S', occupancy: 40 },
  61. { id: 't', title: 'Auditorium T', occupancy: 40 },
  62. { id: 'u', title: 'Auditorium U', occupancy: 40 },
  63. { id: 'v', title: 'Auditorium V', occupancy: 40 },
  64. { id: 'w', title: 'Auditorium W', occupancy: 40 },
  65. { id: 'x', title: 'Auditorium X', occupancy: 40 },
  66. { id: 'y', title: 'Auditorium Y', occupancy: 40 },
  67. { id: 'z', title: 'Auditorium Z', occupancy: 40 }
  68. ],
  69. events: [
  70. { id: '1', resourceId: 'b', start: '2020-09-07T02:00:00', end: '2020-09-07T07:00:00', title: 'event 1' },
  71. { id: '2', resourceId: 'c', start: '2020-09-07T05:00:00', end: '2020-09-07T22:00:00', title: 'event 2' },
  72. { id: '3', resourceId: 'd', start: '2020-09-06', end: '2020-09-08', title: 'event 3' },
  73. { id: '4', resourceId: 'e', start: '2020-09-07T03:00:00', end: '2020-09-07T08:00:00', title: 'event 4' },
  74. { id: '5', resourceId: 'f', start: '2020-09-07T00:30:00', end: '2020-09-07T02:30:00', title: 'event 5' }
  75. ]
  76. });
  77. calendar.render();
  78. });
  79. </script>
  80. <style>
  81. body {
  82. margin: 0;
  83. padding: 0;
  84. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  85. font-size: 14px;
  86. }
  87. #calendar {
  88. max-width: 1100px;
  89. margin: 50px auto;
  90. }
  91. </style>
  92. </head>
  93. <body>
  94. <div id='calendar'></div>
  95. </body>
  96. </html>