google-calendar.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8' />
  5. <script src='../../packages/core/dist/index.global.js'></script>
  6. <script src='../../packages/daygrid/dist/index.global.js'></script>
  7. <script src='../../packages/list/dist/index.global.js'></script>
  8. <script src='../../packages/google-calendar/dist/index.global.js'></script>
  9. <script>
  10. document.addEventListener('DOMContentLoaded', function() {
  11. var calendarEl = document.getElementById('calendar');
  12. var calendar = new FullCalendar.Calendar(calendarEl, {
  13. headerToolbar: {
  14. left: 'prev,next today',
  15. center: 'title',
  16. right: 'dayGridMonth,listYear'
  17. },
  18. displayEventTime: false, // don't show the time column in list view
  19. // THIS KEY WON'T WORK IN PRODUCTION!!!
  20. // To make your own Google API key, follow the directions here:
  21. // https://fullcalendar.io/docs/google-calendar/
  22. googleCalendarApiKey: 'AIzaSyDcnW6WejpTOCffshGDDb4neIrXVUA1EAE',
  23. // US Holidays
  24. events: 'en.usa#[email protected]',
  25. eventClick: function(arg) {
  26. // opens events in a popup window
  27. window.open(arg.event.url, 'google-calendar-event', 'width=700,height=600');
  28. arg.jsEvent.preventDefault() // don't navigate in main tab
  29. },
  30. loading: function(bool) {
  31. document.getElementById('loading').style.display =
  32. bool ? 'block' : 'none';
  33. }
  34. });
  35. calendar.render();
  36. });
  37. </script>
  38. <style>
  39. body {
  40. margin: 40px 10px;
  41. padding: 0;
  42. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  43. font-size: 14px;
  44. }
  45. #loading {
  46. display: none;
  47. position: absolute;
  48. top: 10px;
  49. right: 10px;
  50. }
  51. #calendar {
  52. max-width: 1100px;
  53. margin: 0 auto;
  54. }
  55. </style>
  56. </head>
  57. <body>
  58. <div id='loading'>loading...</div>
  59. <div id='calendar'></div>
  60. </body>
  61. </html>