timeline.html 4.4 KB

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