generated from mmistakes/mm-github-pages-starter
-
Notifications
You must be signed in to change notification settings - Fork 14
/
upcoming-events.html
54 lines (49 loc) · 1.44 KB
/
upcoming-events.html
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
<div id='calendar'></div>
<p class="text-right">
<a href='{{ "/programme/calendar/" | relative_url }}'>Full event calendar</a>
<a href="{{ site.shared_calendar }}">Add all events to your calendar</a>
</p>
<script>
document.addEventListener('DOMContentLoaded', function() {
var calendarEl = document.getElementById('calendar');
var events = [
{%- if include.all or include.ask_us_anything -%}
{% include ask-us-anything.js %},
{%- endif -%}
{%- if include.all or include.cfc_deadlines -%}
{% include cfc-deadlines.js %},
{%- endif -%}
{%- if include.all or include.events or include.category -%}
{% include events.js category=include.category onclick=include.onclick %},
{%- endif -%}
{%- if include.all or include.posts -%}
{% include posts.js %},
{%- endif -%}
{%- if include.custom -%}
{{ include.custom }}
{%- else -%}
{}
{%- endif -%}
];
events.sort((e1, e2) => new Date(e1.start) - new Date(e2.start));
calendar = new FullCalendar.Calendar(calendarEl, {
headerToolbar: false,
aspectRatio: 2,
noEventsContent: "No upcoming events",
initialView: 'listAll',
editable: true,
selectable: true,
events: events,
views: {
listAll: {
type: "list",
visibleRange: {
start: new Date(),
end: "2021-12-31"
}
}
}
});
calendar.render();
});
</script>