week-numbers.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8' />
  5. <link href='../lib/main.css' rel='stylesheet' />
  6. <script src='../lib/main.js'></script>
  7. <script>
  8. document.addEventListener('DOMContentLoaded', function() {
  9. var calendarEl = document.getElementById('calendar');
  10. var calendar = new FullCalendar.Calendar(calendarEl, {
  11. headerToolbar: {
  12. left: 'prev,next today',
  13. center: 'title',
  14. right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
  15. },
  16. initialDate: '2020-06-12',
  17. navLinks: true, // can click day/week names to navigate views
  18. nowIndicator: true,
  19. weekNumbers: true,
  20. weekNumberCalculation: 'ISO',
  21. editable: true,
  22. selectable: true,
  23. dayMaxEvents: true, // allow "more" link when too many events
  24. events: [
  25. {
  26. title: 'All Day Event',
  27. start: '2020-06-01'
  28. },
  29. {
  30. title: 'Long Event',
  31. start: '2020-06-07',
  32. end: '2020-06-10'
  33. },
  34. {
  35. groupId: 999,
  36. title: 'Repeating Event',
  37. start: '2020-06-09T16:00:00'
  38. },
  39. {
  40. groupId: 999,
  41. title: 'Repeating Event',
  42. start: '2020-06-16T16:00:00'
  43. },
  44. {
  45. title: 'Conference',
  46. start: '2020-06-11',
  47. end: '2020-06-13'
  48. },
  49. {
  50. title: 'Meeting',
  51. start: '2020-06-12T10:30:00',
  52. end: '2020-06-12T12:30:00'
  53. },
  54. {
  55. title: 'Lunch',
  56. start: '2020-06-12T12:00:00'
  57. },
  58. {
  59. title: 'Meeting',
  60. start: '2020-06-12T14:30:00'
  61. },
  62. {
  63. title: 'Happy Hour',
  64. start: '2020-06-12T17:30:00'
  65. },
  66. {
  67. title: 'Dinner',
  68. start: '2020-06-12T20:00:00'
  69. },
  70. {
  71. title: 'Birthday Party',
  72. start: '2020-06-13T07:00:00'
  73. },
  74. {
  75. title: 'Click for Google',
  76. url: 'http://google.com/',
  77. start: '2020-06-28'
  78. }
  79. ]
  80. });
  81. calendar.render();
  82. });
  83. </script>
  84. <style>
  85. body {
  86. margin: 40px 10px;
  87. padding: 0;
  88. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  89. font-size: 14px;
  90. }
  91. #calendar {
  92. max-width: 1100px;
  93. margin: 0 auto;
  94. }
  95. </style>
  96. </head>
  97. <body>
  98. <div id='calendar'></div>
  99. </body>
  100. </html>