triggers_view.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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 src='../../dist/plugins/google-calendar.js'></script>
  10. <script>
  11. var date = new Date();
  12. var d = date.getDate();
  13. var m = date.getMonth();
  14. var y = date.getFullYear();
  15. var verbose = false;
  16. $(document).ready(function() {
  17. $('#calendar').fullCalendar({
  18. headerToolbar: {
  19. left: 'prev,next today',
  20. center: 'title',
  21. right: 'month,week,dayGridWeek,day,dayGridDay'
  22. },
  23. editable: true,
  24. selectable: true,
  25. eventDestroy: function(event, element) {
  26. console.log('eventDestroy');
  27. //alert('eventDestroy');
  28. if (verbose) {
  29. console.log(' this', this);
  30. console.log(' event', event);
  31. console.log(' element', element);
  32. }
  33. },
  34. eventSources: [
  35. {
  36. url: "http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic",
  37. editable: true,
  38. className: 'holiday'
  39. },
  40. {
  41. events: [
  42. {
  43. title: 'All Day Event',
  44. start: new Date(y, m, 1)
  45. },
  46. {
  47. title: 'Long Event',
  48. start: new Date(y, m, d-5),
  49. end: new Date(y, m, d-2)
  50. },
  51. {
  52. groupId: 999,
  53. title: 'Repeating Event',
  54. start: new Date(y, m, d-3, 16, 0),
  55. allDay: false
  56. },
  57. {
  58. groupId: 999,
  59. title: 'Repeating Event',
  60. start: new Date(y, m, d+4, 16, 0),
  61. allDay: false
  62. },
  63. {
  64. id: 888,
  65. title: 'Meeting',
  66. start: new Date(y, m, d, 10, 30),
  67. allDay: false
  68. },
  69. {
  70. id: 777,
  71. title: 'Lunch',
  72. start: new Date(y, m, d, 12, 0),
  73. end: new Date(y, m, d, 14, 0),
  74. allDay: false
  75. },
  76. {
  77. title: 'Birthday Party',
  78. start: new Date(y, m, d+1, 19, 0),
  79. end: new Date(y, m, d+1, 22, 30),
  80. allDay: false
  81. },
  82. {
  83. title: 'Click for Google',
  84. start: new Date(y, m, 28),
  85. end: new Date(y, m, 29),
  86. url: 'http://google.com/'
  87. }
  88. ]
  89. }
  90. ]
  91. });
  92. });
  93. function hyperJump() {console.log('hyperJump');
  94. $('#calendar').fullCalendar('changeView', 'week');
  95. //alert('pause');
  96. $('#calendar').fullCalendar('gotoDate', new Date(y, m+2, d));
  97. }
  98. </script>
  99. </head>
  100. <body style='font-size:14px'>
  101. <button onclick='hyperJump()'>changeView+gotoDate</button>
  102. <div id='calendar' style='width:75%;margin:20px auto 0;font-family:arial'></div>
  103. </body>
  104. </html>