mirror of
https://github.com/nikdoof/website-hugo.git
synced 2025-12-14 13:52:17 +00:00
Cleanup calendar CSS/JS load order
This commit is contained in:
@@ -22,5 +22,37 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
|
||||
function render_calendar() {
|
||||
const calendar = new tui.Calendar('#calendar', {
|
||||
defaultView: 'month',
|
||||
isReadOnly: true,
|
||||
useDetailPopup: true,
|
||||
usageStatistics: false,
|
||||
calendars: [
|
||||
{
|
||||
id: '1',
|
||||
name: 'Hackspace Events',
|
||||
backgroundColor: '#ff0000',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
$.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