Spaces:
Running
Running
File size: 4,965 Bytes
45d5d8a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
/**
* WEBSITE: https://themefisher.com
* TWITTER: https://twitter.com/themefisher
* FACEBOOK: https://www.facebook.com/themefisher
* GITHUB: https://github.com/themefisher/
*/
/* ====== Index ======
1. CALENDAR JS
====== End ======*/
document.addEventListener("DOMContentLoaded", function () {
var calendarEl = document.getElementById("calendar");
var year = new Date().getFullYear();
var month = new Date().getMonth() + 1;
function n(n) {
return n > 9 ? "" + n : "0" + n;
}
var month = n(month);
var calendar = new FullCalendar.Calendar(calendarEl, {
plugins: ["dayGrid"],
defaultView: "dayGridMonth",
eventRender: function (info) {
var ntoday = moment().format("YYYYMMDD");
var eventStart = moment(info.event.start).format("YYYYMMDD");
info.el.setAttribute("title", info.event.extendedProps.description);
info.el.setAttribute("data-toggle", "tooltip");
if (eventStart < ntoday) {
info.el.classList.add("fc-past-event");
} else if (eventStart == ntoday) {
info.el.classList.add("fc-current-event");
} else {
info.el.classList.add("fc-future-event");
}
},
events: [
{
title: "All Day Event",
description: "description for All Day Event",
start: year + "-" + month + "-01",
},
{
title: "First Day Event",
description: "description for First Day Event",
start: year + "-" + month + "-03",
},
{
title: "Second Day Event",
description: "description for Second Day Event",
start: year + "-" + month + "-05",
},
{
title: "Long Event",
description: "description for Long Event",
start: year + "-" + month + "-07",
end: year + "-" + month + "-10",
},
{
groupId: "999",
title: "Repeating Event",
description: "description for Repeating Event",
start: year + "-" + month + "-09T16:00:00",
},
{
groupId: "999",
title: "Repeating Event",
description: "description for Repeating Event",
start: year + "-" + month + "-16T16:00:00",
end: year + "-" + month + "-16T16:00:00",
},
{
title: "Conference",
description: "description for Conference",
start: year + "-" + month + "-11",
end: year + "-" + month + "-13",
},
{
title: "Meeting",
description: "description for Meeting",
start: year + "-" + month + "-12T10:30:00",
end: year + "-" + month + "-12T12:30:00",
},
{
title: "Lunch",
description: "description for Lunch",
start: year + "-" + month + "-12T12:00:00",
end: year + "-" + month + "-12T12:00:00",
},
{
title: "Meeting",
description: "description for Meeting",
start: year + "-" + month + "-12T14:30:00",
end: year + "-" + month + "-12T14:30:00",
},
{
title: "Birthday Party",
description: "description for Birthday Party",
start: year + "-" + month + "-13T24:00:00",
end: year + "-" + month + "-13T24:00:00",
},
{
title: "Long Event",
description: "description for Long Event",
start: year + "-" + month + "-20",
end: year + "-" + month + "-23",
},
{
groupId: "999",
title: "Repeating Event",
description: "description for Repeating Event",
start: year + "-" + month + "-22T16:00:00",
},
{
title: "Conference",
description: "description for Conference",
start: year + "-" + month + "-24",
end: year + "-" + month + "-27",
},
{
title: "Meeting",
description: "description for Meeting",
start: year + "-" + month + "-26T10:30:00",
end: year + "-" + month + "-26T12:30:00",
},
{
title: "Lunch",
description: "description for Lunch",
start: year + "-" + month + "-26T12:00:00",
end: year + "-" + month + "-26T12:00:00",
},
{
title: "Meeting",
description: "description for Meeting",
start: year + "-" + month + "-26T14:30:00",
end: year + "-" + month + "-26T14:30:00",
},
{
title: "Click for Google",
description: "description for Click for Google",
url: "http://google.com/",
start: year + "-" + month + "-28",
end: year + "-" + month + "-28",
},
{
title: "Lunch",
description: "description for Lunch",
start: year + "-" + month + "-30T12:00:00",
end: year + "-" + month + "-31T12:00:00",
},
{
title: "Meeting",
description: "description for Meeting",
start: year + "-" + month + "-31T14:30:00",
end: year + "-" + month + "-31T14:30:00",
},
],
});
calendar.render();
});
|