icalendar.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8' />
  5. <link href='../packages/bundle/main.css' rel='stylesheet' />
  6. <script src='https://github.com/mozilla-comm/ical.js/releases/download/v1.4.0/ical.js'></script>
  7. <script src='../packages/bundle/main.js'></script>
  8. <script src='../packages/icalendar/main.global.js'></script>
  9. <script>
  10. document.addEventListener('DOMContentLoaded', function() {
  11. var calendarEl = document.getElementById('calendar');
  12. var calendar = new FullCalendar.Calendar(calendarEl, {
  13. displayEventTime: false,
  14. initialDate: '2019-04-01',
  15. headerToolbar: {
  16. left: 'prev,next today',
  17. center: 'title',
  18. right: 'dayGridMonth,listYear'
  19. },
  20. events: {
  21. url: 'ics/feed.ics',
  22. format: 'ics',
  23. failure: function() {
  24. document.getElementById('script-warning').style.display = 'block';
  25. }
  26. },
  27. loading: function(bool) {
  28. document.getElementById('loading').style.display =
  29. bool ? 'block' : 'none';
  30. }
  31. });
  32. calendar.render();
  33. });
  34. </script>
  35. <style>
  36. body {
  37. margin: 0;
  38. padding: 0;
  39. font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
  40. font-size: 14px;
  41. }
  42. #script-warning {
  43. display: none;
  44. background: #eee;
  45. border-bottom: 1px solid #ddd;
  46. padding: 0 10px;
  47. line-height: 40px;
  48. text-align: center;
  49. font-weight: bold;
  50. font-size: 12px;
  51. color: red;
  52. }
  53. #loading {
  54. display: none;
  55. position: absolute;
  56. top: 10px;
  57. right: 10px;
  58. }
  59. #calendar {
  60. max-width: 1100px;
  61. margin: 40px auto;
  62. padding: 0 10px;
  63. }
  64. </style>
  65. </head>
  66. <body>
  67. <div id='script-warning'>
  68. <code>ics/feed.ics</code> must be servable
  69. </div>
  70. <div id='loading'>loading...</div>
  71. <div id='calendar'></div>
  72. </body>
  73. </html>