Minify calendar JS

This commit is contained in:
2024-02-11 09:22:49 +00:00
parent 8a9884b7d7
commit eaf47acc7f
2 changed files with 29 additions and 28 deletions

26
assets/js/calendar.js Normal file
View File

@@ -0,0 +1,26 @@
var events = [];
$(document).ready(function () {
$.getJSON('https://api.leighhack.org/events', function (data) {
data.forEach(function (event) {
events.push({
id: event['uid'],
title: event['summary'],
body: event['description'],
state: 'Free',
dueDateClass: '',
start: event['start']['dateTime'],
end: event['end']['dateTime'],
})
});
let ec = new EventCalendar(document.getElementById('calendar'), {
view: 'listMonth',
events: events,
headerToolbar: {
start: 'prev,next today',
center: 'title',
end: 'dayGridMonth, listMonth'
},
});
});
});