Thanks for the quick reply!
I’ve turned debug mode on but no error messages showed up.
These are my files:
/content/events/calendar.de.txt
Title: Events
----
Calendar:
-
summary: My event
description: A super cool event
_begin_date: 2016-05-22
_begin_time: 10:00
_end_date: 2016-05-22
_end_time: 11:00
/site/languages/de.php
<?php
l::set('calendar-time-format', '%d');
l::set('calendar-full-time-format', '%d %X');
l::set('calendar-month-format', '%B %Y');
l::set('calendar-no-entry', 'Zur Zeit gibt es keine Events.');
l::set('date', 'Datum');
l::set('to', 'bis');
l::set('title', 'Titel');
l::set('description', 'Beschreibung');
/site/plugins/calendar/calendar.php
<?php
if (!class_exists('Calendar')) require_once('lib/Calendar.php');
if (!class_exists('Event')) require_once('lib/Event.php');
function calendar($events = array()) {
try {
return new Calendar($events);
} catch (Exception $e) {
print "<strong>The calendar plugin threw an error</strong><br>" .
$e->getMessage();
}
}
/site/templates/calendar-div.php
<?php
$tmpDate = getdate(0);
$currentDate = getdate();
?>
<section class="calendar">
<?php
if (!$calendar->getAllEvents()):
echo l::get('calendar-no-entry');
else:
?>
<div class="row head">
<div class="item"><?php echo l::get('date'); ?></div>
<?php foreach ($fields as $field): ?>
<div class="item"><?php echo $field; ?></div>
<?php endforeach; ?>
</div>
<?php foreach ($calendar->getAllEvents() as $event):
$date = $event->getBeginDate();
?>
<?php if ($tmpDate['mon'] < $date['mon'] || $tmpDate['year'] < $date['year']): ?>
<div class="row month<?php e($date['mon'] < $currentDate['mon'] or $date['year'] < $currentDate['year'], ' past'); ?>">
<div class="item"><?php echo strftime(l::get('calendar-month-format'), $date[0]); ?></div>
</div>
<?php endif; ?>
<div class="row event<?php e($event->isPast(), ' past'); ?>">
<div class="item date"><?php
echo $event->getBeginHtml();
if ($event->hasEnd()) {
echo ' '.l::get('to').' '.$event->getEndHtml();
}
?></div>
<?php foreach ($fields as $key => $value): ?>
<div class="item"><?php echo $event->getField($key); ?></div>
<?php endforeach; ?>
</div>
<?php $tmpDate = $date; ?>
<?php endforeach; ?>
<?php endif; ?>
</section>
/site/templates/calendar-ical.php
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//<?php echo $site->url(); ?>//Kirby Calendar Plugin//<?php echo str::upper($site->language()->code()); ?>
METHOD:PUBLISH
<?php foreach ($calendar->getAllEvents() as $event): ?>
BEGIN:VEVENT
DTSTART:<?php echo gmdate('Ymd\THis\Z', $event->getBeginTimestamp()); ?>
DTEND:<?php echo gmdate('Ymd\THis\Z', $event->getEndTimestamp()); ?>
SUMMARY:<?php echo $event->getField('summary') ?>
DESCRIPTION:<?php echo $event->getField('description') ?>
LOCATION:<?php echo $event->getField('location') ?>
END:VEVENT
<?php endforeach; ?>
END:VCALENDAR
/site/templates/calendar-table.php
<?php
$tmpDate = getdate(0);
$currentDate = getdate();
?>
<table class="calendar">
<?php if (!$calendar->getAllEvents()): ?>
<tr><td><?php echo l::get('calendar-no-entry'); ?></td></tr>
<?php else: ?>
<thead>
<tr>
<th><?php echo l::get('date'); ?></th>
<?php foreach ($fields as $field): ?>
<th><?php echo $field; ?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($calendar->getAllEvents() as $event):
$date = $event->getBeginDate();
?>
<?php if ($tmpDate['mon'] < $date['mon'] || $tmpDate['year'] < $date['year']): ?>
<tr class="month<?php e($date['mon'] < $currentDate['mon'] or $date['year'] < $currentDate['year'], ' past'); ?>">
<td colspan="<?php echo count($fields)+1; ?>"><?php echo strftime(l::get('calendar-month-format'), $date[0]); ?></td>
</tr>
<?php endif; ?>
<tr class="event<?php e($event->isPast(), ' past'); ?>">
<td><?php
echo $event->getBeginHtml();
if ($event->hasEnd()) {
echo ' '.l::get('to').' '.$event->getEndHtml();
}
?></td>
<?php foreach ($fields as $key => $value): ?>
<td><?php echo $event->getField($key); ?></td>
<?php endforeach; ?>
</tr>
<?php $tmpDate = $date; ?>
<?php endforeach; ?>
</tbody>
<?php endif; ?>
</table>
/site/templates/calendar-teaser.php
<ul class="teaser">
<?php
foreach ($calendar->getEvents() as $event):
if (--$items < 0) break;
?>
<li><strong><?php echo $event->getBeginHtml(); ?></strong><?php
foreach ($fields as $key => $value) {
echo ' '.$event->getField($key);
}
?></li>
<?php endforeach; ?>
</ul>
/site/templates/calendar.php
<?php $calendar = calendar($page->calendar()->yaml()); ?>