mirror of
https://github.com/nikdoof/website-hugo.git
synced 2025-12-14 15:02:29 +00:00
Switch calendar library (fixes #4)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user