Remove calendar script workaround

This commit is contained in:
sodoku 2019-01-28 22:31:39 +01:00
parent 81a2bb35dd
commit 6433810d98
2 changed files with 69 additions and 64 deletions

View file

@ -3,7 +3,12 @@ import '../elements/time';
function getEvents(number, callback) {
const now = new Date();
const allEvents = window.c_base_events.concat(window.c_base_regulars, window.c_base_seminars);
fetch('/../calendar')
.then(res => res.json())
.then((calendars) => {
const allEvents = calendars.c_base_events.concat(
calendars.c_base_regulars, calendars.c_base_seminars,
);
const current = allEvents.filter((event) => {
if (event.id === 45) {
return false;
@ -72,6 +77,7 @@ function getEvents(number, callback) {
});
return callback(events.slice(0, number));
});
});
}
let prevDate = new Date();

View file

@ -5,7 +5,6 @@
<title>c-base event calendar</title>
<script src="../vendor/webcomponentsjs/webcomponents-lite.js"></script>
<script src="../vendor/webcomponentsjs/custom-elements-es5-adapter.js"></script>
<script src="https://www.c-base.org/calendar/exported/events.js"></script>
<script src="../lib/calendar.js"></script>
<link rel="stylesheet" href="../theme/c-base.css">
<style>