Merge pull request #36 from c-base/calendarJson
Remove calendar script workaround
This commit is contained in:
commit
169759264f
2 changed files with 69 additions and 64 deletions
|
@ -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();
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue