timeline-full-height.html 3.4 KB

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