sources_new.html 4.0 KB

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