timeline.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. now: '2019-08-07',
  12. editable: true, // enable draggable events
  13. aspectRatio: 1.8,
  14. scrollTime: '00:00', // undo default 6am scrollTime
  15. header: {
  16. left: 'today prev,next',
  17. center: 'title',
  18. right: 'resourceTimelineDay,resourceTimelineThreeDays,timeGridWeek,dayGridMonth,listWeek'
  19. },
  20. defaultView: 'resourceTimelineDay',
  21. views: {
  22. resourceTimelineThreeDays: {
  23. type: 'resourceTimeline',
  24. duration: { days: 3 },
  25. buttonText: '3 days'
  26. }
  27. },
  28. resourceLabelText: 'Rooms',
  29. resources: [
  30. { id: 'a', title: 'Auditorium A' },
  31. { id: 'b', title: 'Auditorium B', eventColor: 'green' },
  32. { id: 'c', title: 'Auditorium C', eventColor: 'orange' },
  33. { id: 'd', title: 'Auditorium D', children: [
  34. { id: 'd1', title: 'Room D1' },
  35. { id: 'd2', title: 'Room D2' }
  36. ] },
  37. { id: 'e', title: 'Auditorium E' },
  38. { id: 'f', title: 'Auditorium F', eventColor: 'red' },
  39. { id: 'g', title: 'Auditorium G' },
  40. { id: 'h', title: 'Auditorium H' },
  41. { id: 'i', title: 'Auditorium I' },
  42. { id: 'j', title: 'Auditorium J' },
  43. { id: 'k', title: 'Auditorium K' },
  44. { id: 'l', title: 'Auditorium L' },
  45. { id: 'm', title: 'Auditorium M' },
  46. { id: 'n', title: 'Auditorium N' },
  47. { id: 'o', title: 'Auditorium O' },
  48. { id: 'p', title: 'Auditorium P' },
  49. { id: 'q', title: 'Auditorium Q' },
  50. { id: 'r', title: 'Auditorium R' },
  51. { id: 's', title: 'Auditorium S' },
  52. { id: 't', title: 'Auditorium T' },
  53. { id: 'u', title: 'Auditorium U' },
  54. { id: 'v', title: 'Auditorium V' },
  55. { id: 'w', title: 'Auditorium W' },
  56. { id: 'x', title: 'Auditorium X' },
  57. { id: 'y', title: 'Auditorium Y' },
  58. { id: 'z', title: 'Auditorium Z' }
  59. ],
  60. events: [
  61. { id: '1', resourceId: 'b', start: '2019-08-07T02:00:00', end: '2019-08-07T07:00:00', title: 'event 1' },
  62. { id: '2', resourceId: 'c', start: '2019-08-07T05:00:00', end: '2019-08-07T22:00:00', title: 'event 2' },
  63. { id: '3', resourceId: 'd', start: '2019-08-06', end: '2019-08-08', title: 'event 3' },
  64. { id: '4', resourceId: 'e', start: '2019-08-07T03:00:00', end: '2019-08-07T08:00:00', title: 'event 4' },
  65. { id: '5', resourceId: 'f', start: '2019-08-07T00:30:00', end: '2019-08-07T02:30:00', title: 'event 5' }
  66. ]
  67. });
  68. calendar.render();
  69. });
  70. </script>
  71. <style>
  72. body {
  73. margin: 0;
  74. padding: 0;
  75. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  76. font-size: 14px;
  77. }
  78. #calendar {
  79. max-width: 900px;
  80. margin: 50px auto;
  81. }
  82. </style>
  83. </head>
  84. <body>
  85. <div id='calendar'></div>
  86. </body>
  87. </html>