issue_757_removeEvents.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link href='../../dist/fullcalendar.css' rel='stylesheet' />
  5. <link href='../../dist/fullcalendar.print.css' rel='stylesheet' media='print' />
  6. <script src='../../node_modules/jquery/dist/jquery.js'></script>
  7. <script src='../../node_modules/moment/moment.js'></script>
  8. <script src='../../dist/fullcalendar.js'></script>
  9. <script>
  10. $(document).ready(function() {
  11. var date = new Date();
  12. var d = date.getDate();
  13. var m = date.getMonth();
  14. var y = date.getFullYear();
  15. $('#calendar').fullCalendar({
  16. headerToolbar: {
  17. left: 'prev,next today',
  18. center: 'title',
  19. right: 'month,week,dayGridWeek,day,dayGridDay'
  20. },
  21. editable: true,
  22. //direction: 'rtl',
  23. year: 2011,
  24. month: 0,
  25. events: [
  26. {
  27. title: 'All Day Event',
  28. start: new Date(y, m, 1)
  29. },
  30. {
  31. title: 'Long Event',
  32. start: new Date(y, m, d-5),
  33. end: new Date(y, m, d-2)
  34. },
  35. {
  36. groupId: 999,
  37. title: 'Repeating Event',
  38. start: new Date(y, m, d-3, 16, 0),
  39. allDay: false
  40. },
  41. {
  42. groupId: 999,
  43. title: 'Repeating Event',
  44. start: new Date(y, m, d+4, 16, 0),
  45. allDay: false
  46. },
  47. {
  48. title: 'Meeting',
  49. start: new Date(y, m, d, 10, 30),
  50. allDay: false
  51. },
  52. {
  53. title: 'Lunch',
  54. start: new Date(y, m, d, 12, 5),
  55. end: new Date(y, m, d, 14, 43),
  56. allDay: false
  57. },
  58. {
  59. title: 'Birthday Party',
  60. start: new Date(y, m, d+1, 19, 0),
  61. end: new Date(y, m, d+1, 22, 30),
  62. allDay: false
  63. },
  64. {
  65. title: 'Click for Google',
  66. start: new Date(y, m, 28),
  67. end: new Date(y, m, 29),
  68. url: 'http://google.com/'
  69. }
  70. ]
  71. });
  72. });
  73. </script>
  74. <style>
  75. body {
  76. margin-top: 40px;
  77. text-align: center;
  78. font-size: 13px;
  79. font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
  80. }
  81. #calendar {
  82. width: 900px;
  83. margin: 0 auto;
  84. }
  85. </style>
  86. </head>
  87. <body>
  88. <button onclick="$('#calendar').fullCalendar('removeEvents')">removeEvents</button>
  89. <button onclick="$('#calendar').fullCalendar('renderEvent', { title:'hey', start:'2011-01-09' }, true)">addEvent (with stick)</button>
  90. <div id='calendar'></div>
  91. </body>
  92. </html>