sources_new.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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. /*
  12. (main options)
  13. startParam
  14. endParam
  15. cacheParam
  16. ignoreTimezone
  17. defaultAllDay
  18. editable
  19. eventColor
  20. eventTextColor
  21. eventBorderColor
  22. eventBackgroundColor
  23. (event source)
  24. startParam
  25. endParam
  26. cacheParam
  27. ignoreTimezone
  28. defaultAllDay
  29. className
  30. editable
  31. color
  32. textColor
  33. borderColor
  34. backgroundColor
  35. (event)
  36. className
  37. editable
  38. color
  39. textColor
  40. borderColor
  41. backgroundColor
  42. */
  43. $(document).ready(function() {
  44. var date = new Date();
  45. var d = date.getDate();
  46. var m = date.getMonth();
  47. var y = date.getFullYear();
  48. $('#calendar').fullCalendar({
  49. headerToolbar: {
  50. left: 'prev,next today',
  51. center: 'title',
  52. right: 'month,week,dayGridWeek,day,dayGridDay'
  53. },
  54. editable: true,
  55. //eventStartEditable: false,
  56. //eventDurationEditable: false,
  57. selectable: true,
  58. selectMirror: true,
  59. eventSources: [
  60. {
  61. url: 'http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic',
  62. color: 'orange',
  63. className: 'google-calendar',
  64. success: function(events) {
  65. console.log('successfully loaded google-calendar event data!', events);
  66. },
  67. editable: true
  68. },
  69. /*
  70. FullCalendar.gcalFeed('http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic', {
  71. color: 'orange',
  72. className: 'google-calendar'
  73. }),
  74. */
  75. {
  76. url: "../demos/json-events.php",
  77. //editable: false,
  78. color: 'red',
  79. data: {
  80. something: 'cool'
  81. },
  82. success: function() {
  83. console.log('json-events.php is done!!!', arguments);
  84. }
  85. },
  86. {
  87. color: 'purple',
  88. //editable: false,
  89. //startEditable: false,
  90. //durationEditable: false,
  91. events: [
  92. {
  93. title: 'All Day Event',
  94. //startEditable: false,
  95. //durationEditable: false,
  96. start: new Date(y, m, 1)
  97. },
  98. {
  99. title: 'Long Event',
  100. start: new Date(y, m, d-5),
  101. end: new Date(y, m, d-2)
  102. },
  103. {
  104. groupId: 999,
  105. title: 'Repeating Event',
  106. start: new Date(y, m, d-3, 16, 0),
  107. allDay: false
  108. },
  109. {
  110. groupId: 999,
  111. title: 'Repeating Event',
  112. start: new Date(y, m, d+4, 16, 0),
  113. allDay: false
  114. }
  115. ]
  116. },
  117. {
  118. events: [
  119. {
  120. title: 'Meeting',
  121. start: new Date(y, m, d, 10, 30),
  122. allDay: false
  123. },
  124. {
  125. title: 'Lunch',
  126. start: new Date(y, m, d, 12, 5),
  127. end: new Date(y, m, d, 14, 43),
  128. allDay: false
  129. },
  130. {
  131. title: 'Birthday Party',
  132. start: new Date(y, m, d+1, 19, 0),
  133. end: new Date(y, m, d+1, 22, 30),
  134. allDay: false
  135. },
  136. {
  137. title: 'Click for Google',
  138. start: new Date(y, m, 28),
  139. end: new Date(y, m, 29),
  140. url: 'http://google.com/'
  141. }
  142. ]
  143. }
  144. ],
  145. eventClick: function(event) {
  146. if (event.url) {
  147. window.open(event.url);
  148. }
  149. return false;
  150. }
  151. });
  152. });
  153. </script>
  154. <style>
  155. body {
  156. margin-top: 40px;
  157. text-align: center;
  158. font-size: 13px;
  159. font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
  160. }
  161. #calendar {
  162. width: 900px;
  163. margin: 0 auto;
  164. }
  165. </style>
  166. </head>
  167. <body>
  168. <div id='calendar'></div>
  169. </body>
  170. </html>