_chrome91-bug-timeline.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8' />
  5. <link href='../packages/core/dist/main.css' rel='stylesheet' />
  6. <link href='../packages-premium/timeline/dist/main.css' rel='stylesheet' />
  7. <link href='../packages-premium/resource-timeline/dist/main.css' rel='stylesheet' />
  8. <script src='../packages/core/dist/main.js'></script>
  9. <script src='../packages/interaction/dist/main.js'></script>
  10. <script src='../packages-premium/timeline/dist/main.js'></script>
  11. <script src='../packages-premium/resource-common/dist/main.js'></script>
  12. <script src='../packages-premium/resource-timeline/dist/main.js'></script>
  13. <script>
  14. document.addEventListener('DOMContentLoaded', function() {
  15. var calendarEl = document.getElementById('calendar');
  16. var calendar = new FullCalendar.Calendar(calendarEl, {
  17. plugins: [ 'interaction', 'resourceTimeline' ],
  18. timeZone: 'UTC',
  19. editable: true,
  20. // slotWidth: 15, // bug is made worse if small value
  21. slotDuration: '00:15:00',
  22. scrollTime: '24:00:00',
  23. defaultView: 'resourceTimelineDay',
  24. defaultDate: '2021-06-02',
  25. resourceLabelText: 'Rooms',
  26. events: [
  27. {
  28. resourceId: 'a',
  29. title: 'Timed Event',
  30. start: '2021-06-02T16:00:00+00:00'
  31. },
  32. {
  33. resourceId: 'b',
  34. title: 'Conference',
  35. start: '2021-06-02'
  36. },
  37. {
  38. resourceId: 'c',
  39. title: 'Meeting',
  40. start: '2021-06-02T10:30:00+00:00',
  41. end: '2021-06-02T12:30:00+00:00'
  42. },
  43. {
  44. resourceId: 'a',
  45. title: 'Lunch',
  46. start: '2021-06-02T12:00:00+00:00'
  47. }
  48. ],
  49. resources: [
  50. {
  51. id: 'a',
  52. title: 'Auditorium A'
  53. },
  54. {
  55. id: 'b',
  56. title: 'Auditorium B'
  57. },
  58. {
  59. id: 'c',
  60. title: 'Auditorium C'
  61. },
  62. {
  63. id: 'd',
  64. title: 'Auditorium D'
  65. }
  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. /* CSS-only fix for bug */
  83. /* might also need to set slotWidth:30 in Calendar options if slots appear too narrow */
  84. /*
  85. .fc col { min-width: auto !important }
  86. */
  87. </style>
  88. </head>
  89. <body>
  90. <div id='calendar'></div>
  91. </body>
  92. </html>