fullcalendar.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {% removeemptylines %}
  2. {% assign id = include.id | default: 'default' -%}
  3. <div id="calendar-{{ id }}"></div>
  4. {% capture script %}
  5. <script>
  6. document.addEventListener('DOMContentLoaded', function () {
  7. var calendarEl = document.getElementById('calendar-{{ id }}');
  8. var currentYear = new Date().getFullYear();
  9. var currentMonth = new Date().getMonth();
  10. var calendar = new FullCalendar.Calendar(calendarEl, {
  11. initialView: 'dayGridMonth',
  12. {% if include.sample-events %}
  13. events: [
  14. {
  15. title: "Offsite Retreat",
  16. start: new Date(currentYear, currentMonth, 2, 9, 0),
  17. end: new Date(currentYear, currentMonth, 4, 17, 0),
  18. color: 'var(--tblr-red)',
  19. backgroundColor: 'var(--tblr-red-lt)',
  20. borderColor: 'var(--tblr-red-200)',
  21. },
  22. {
  23. title: "Monthly Planning",
  24. start: new Date(currentYear, currentMonth, 1, 10, 0),
  25. end: new Date(currentYear, currentMonth, 1, 11, 30),
  26. },
  27. {
  28. title: "Marketing Strategy Call",
  29. start: new Date(currentYear, currentMonth, 4, 14, 0),
  30. end: new Date(currentYear, currentMonth, 4, 15, 0)
  31. },
  32. {
  33. title: "Design Sprint",
  34. start: new Date(currentYear, currentMonth, 7, 9, 0),
  35. end: new Date(currentYear, currentMonth, 7, 12, 0)
  36. },
  37. {
  38. title: "Dev Team Check-in",
  39. start: new Date(currentYear, currentMonth, 10, 11, 0),
  40. end: new Date(currentYear, currentMonth, 10, 11, 30)
  41. },
  42. {
  43. title: "Customer Feedback Review",
  44. start: new Date(currentYear, currentMonth, 13, 13, 0),
  45. end: new Date(currentYear, currentMonth, 13, 14, 0)
  46. },
  47. {
  48. title: "Mid-Month Review",
  49. start: new Date(currentYear, currentMonth, 15, 10, 30),
  50. end: new Date(currentYear, currentMonth, 15, 11, 30)
  51. },
  52. {
  53. title: "Webinar: Product Update",
  54. start: new Date(currentYear, currentMonth, 18, 16, 0),
  55. end: new Date(currentYear, currentMonth, 18, 17, 0)
  56. },
  57. {
  58. title: "Sales Training",
  59. start: new Date(currentYear, currentMonth, 21, 9, 30),
  60. end: new Date(currentYear, currentMonth, 21, 11, 0)
  61. },
  62. {
  63. title: "Company All-Hands",
  64. start: new Date(currentYear, currentMonth, 25, 15, 0),
  65. end: new Date(currentYear, currentMonth, 25, 16, 0)
  66. },
  67. {
  68. title: "End-of-Month Wrap-up",
  69. start: new Date(currentYear, currentMonth, 31, 10, 0),
  70. end: new Date(currentYear, currentMonth, 31, 11, 0)
  71. }
  72. ],
  73. {% endif %}
  74. });
  75. calendar.render();
  76. });
  77. </script>
  78. {% endcapture %}
  79. {% capture_script %}
  80. {{ script }}
  81. {% endcapture_script %}
  82. {% endremoveemptylines %}