From 7a5df3b0833de46cf2439c40b9a105fc1550265b Mon Sep 17 00:00:00 2001 From: benediktengel Date: Thu, 28 Mar 2019 20:57:55 +0100 Subject: [PATCH] there where bugs :/ --- snippets/calendar.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/snippets/calendar.php b/snippets/calendar.php index 6b76381..b36beea 100644 --- a/snippets/calendar.php +++ b/snippets/calendar.php @@ -67,12 +67,12 @@ } } foreach ($attributes as $attirbute) { - if ($attirbute == 'datestart') { + if ($attirbute == 'dateStart') { $events[$i] += ["datestart" => new DateTime(DateTime::createFromFormat("Y-m-d?H:i:sP", $event['start']['dateTime'])->format(option('benediktengel.G-CalendarPlugin.formatDate')))]; } } foreach ($attributes as $attirbute) { - if ($attirbute == 'timestart') { + if ($attirbute == 'timeStart') { $events[$i] += ["timestart" => new DateTime(DateTime::createFromFormat("Y-m-d?H:i:sP", $event['start']['dateTime'])->format(option('benediktengel.G-CalendarPlugin.formatTime')))]; } } @@ -283,12 +283,18 @@ if (isset($events[$s]['location'])) { echo "

".$events[$s]['location']."

"; } - if (isset($events[$s]['description'])) { + if (isset($events[$s]['description']) && isset($events[$s]['url'])) { if (option('benediktengel.G-CalendarPlugin.cutDescription') == true) { echo "

".substr($events[$s]['description'], 0, option('benediktengel.G-CalendarPlugin.descriptionLength'))."... ".option('benediktengel.G-CalendarPlugin.linkName')."

"; } else { echo "

".$events[$s]['description']."".option('benediktengel.G-CalendarPlugin.linkName')."

"; } + } elseif (isset($events[$s]['description'])) { + if (option('benediktengel.G-CalendarPlugin.cutDescription') == true) { + echo "

".substr($events[$s]['description'], 0, option('benediktengel.G-CalendarPlugin.descriptionLength'))."...

"; + } else { + echo "

".$events[$s]['description']."

"; + } } elseif (isset($events[$s]['url'])) { echo "".option('benediktengel.G-CalendarPlugin.linkName').""; }