Switch calendar library (fixes #4)

This commit is contained in:
2023-11-09 21:15:28 +00:00
parent 7f14d8d070
commit 11f028bdce
2 changed files with 32 additions and 48 deletions

View File

@@ -1,3 +1,7 @@
function titleCase(word) {
return word.charAt(0).toUpperCase() + word.substr(1).toLowerCase();
}
$(document).ready(function () {
$(".navbar-burger").click(function () {
$(".navbar-burger").toggleClass("is-active");
@@ -19,10 +23,6 @@ $(document).ready(function () {
});
}
function titleCase(word) {
return word.charAt(0).toUpperCase() + word.substr(1).toLowerCase();
}
// 'printers' shortcode
if ($('div#printer-status').length) {
$.getJSON("https://api.leighhack.org/space.json", function (data) {
@@ -41,42 +41,3 @@ $(document).ready(function () {
});
}
});
function render_calendar() {
const calendar = new tui.Calendar('#calendar', {
defaultView: 'month',
isReadOnly: true,
useDetailPopup: true,
usageStatistics: false,
month: {
startDayOfWeek: 1,
visibleWeeksCount: 4,
},
calendars: [
{
id: '1',
name: 'Hackspace Events',
backgroundColor: '#d41246',
},
],
});
$.getJSON('https://api.leighhack.org/events', function (data) {
data.forEach(function (event) {
calendar.createEvents([{
id: event['uid'],
calendarId: '1',
title: event['summary'],
body: event['description'],
state: 'Free',
dueDateClass: '',
start: event['start']['dateTime'],
end: event['end']['dateTime'],
}])
});
});
calendar.render();
}