timeline-full-height.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8' />
  5. <link href='../packages-premium/bundle/dist/main.css' rel='stylesheet' />
  6. <script src='../packages-premium/bundle/dist/main.js'></script>
  7. <script>
  8. document.addEventListener('DOMContentLoaded', function() {
  9. var calendarEl = document.getElementById('calendar');
  10. var calendar = new FullCalendar.Calendar(calendarEl, {
  11. // windowResizeDelay: 1000,
  12. height: '100%',
  13. // nowIndicator: true,
  14. editable: true, // enable draggable events
  15. aspectRatio: 1.8,
  16. scrollTime: '00:00', // undo default 6am scrollTime
  17. header: {
  18. left: 'today prev,next',
  19. center: 'title',
  20. right: 'resourceTimelineDay,resourceTimelineThreeDays,timeGridWeek,dayGridMonth,listWeek'
  21. },
  22. defaultView: 'resourceTimelineDay',
  23. views: {
  24. resourceTimelineThreeDays: {
  25. type: 'resourceTimeline',
  26. duration: { days: 3 },
  27. buttonText: '3 days'
  28. }
  29. },
  30. expandRows: true,
  31. resourceLabelText: 'Rooms',
  32. resources: [
  33. { id: 'a', title: 'Auditorium A' },
  34. { id: 'b', title: 'Auditorium B', eventColor: 'green' },
  35. { id: 'c', title: 'Auditorium C', eventColor: 'orange' },
  36. { id: 'd', title: 'Auditorium D', children: [
  37. { id: 'd1', title: 'Room D1' },
  38. { id: 'd2', title: 'Room D2' }
  39. ] },
  40. { id: 'e', title: 'Auditorium E' },
  41. { id: 'f', title: 'Auditorium F', eventColor: 'red' },
  42. // { id: 'g', title: 'Auditorium G' },
  43. // { id: 'h', title: 'Auditorium H' },
  44. // { id: 'i', title: 'Auditorium I' },
  45. // { id: 'j', title: 'Auditorium J' },
  46. // { id: 'k', title: 'Auditorium K' },
  47. // { id: 'l', title: 'Auditorium L' },
  48. // { id: 'm', title: 'Auditorium M' },
  49. // { id: 'n', title: 'Auditorium N' },
  50. // { id: 'o', title: 'Auditorium O' },
  51. // { id: 'p', title: 'Auditorium P' },
  52. // { id: 'q', title: 'Auditorium Q' },
  53. // { id: 'r', title: 'Auditorium R' },
  54. // { id: 's', title: 'Auditorium S' },
  55. // { id: 't', title: 'Auditorium T' },
  56. // { id: 'u', title: 'Auditorium U' },
  57. // { id: 'v', title: 'Auditorium V' },
  58. // { id: 'w', title: 'Auditorium W' },
  59. // { id: 'x', title: 'Auditorium X' },
  60. // { id: 'y', title: 'Auditorium Y' },
  61. // { id: 'z', title: 'Auditorium Z' }
  62. ],
  63. events: [
  64. { id: '1', resourceId: 'b', start: '2019-08-07T02:00:00', end: '2019-08-07T07:00:00', title: 'event 1' },
  65. { id: '2', resourceId: 'c', start: '2019-08-07T05:00:00', end: '2019-08-07T22:00:00', title: 'event 2' },
  66. { id: '3', resourceId: 'd', start: '2019-08-06', end: '2019-08-08', title: 'event 3' },
  67. { id: '4', resourceId: 'e', start: '2019-08-07T03:00:00', end: '2019-08-07T08:00:00', title: 'event 4' },
  68. { id: '5', resourceId: 'f', start: '2019-08-07T00:30:00', end: '2019-08-07T02:30:00', title: 'event 5' }
  69. ]
  70. });
  71. calendar.render();
  72. });
  73. </script>
  74. <style>
  75. html, body {
  76. overflow: hidden; /* don't do scrollbars */
  77. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  78. font-size: 14px;
  79. }
  80. #calendar-container {
  81. position: fixed;
  82. top: 0;
  83. left: 0;
  84. right: 0;
  85. bottom: 0;
  86. }
  87. .fc-header-toolbar {
  88. /*
  89. the calendar will be butting up against the edges,
  90. but let's scoot in the header's buttons
  91. */
  92. padding-top: 1em;
  93. padding-left: 1em;
  94. padding-right: 1em;
  95. }
  96. </style>
  97. </head>
  98. <body>
  99. <div id='calendar-container'>
  100. <div id='calendar'></div>
  101. </div>
  102. </body>
  103. </html>