Nessuna descrizione

selectable.html 2.9KB

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