Skip to content

Commit

Permalink
there where bugs :/
Browse files Browse the repository at this point in the history
  • Loading branch information
BenediktEngel committed Mar 28, 2019
1 parent d1288cc commit 7a5df3b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions snippets/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')))];
}
}
Expand Down Expand Up @@ -283,12 +283,18 @@
if (isset($events[$s]['location'])) {
echo "<p class='calendar-location'>".$events[$s]['location']."</p>";
}
if (isset($events[$s]['description'])) {
if (isset($events[$s]['description']) && isset($events[$s]['url'])) {
if (option('benediktengel.G-CalendarPlugin.cutDescription') == true) {
echo "<p class='calendar-description'>".substr($events[$s]['description'], 0, option('benediktengel.G-CalendarPlugin.descriptionLength'))."... <a target='_blank' class='calendar-link' href='".$events[$s]['url']."'>".option('benediktengel.G-CalendarPlugin.linkName')."</a></p>";
} else {
echo "<p class='calendar-description'>".$events[$s]['description']."<a target='_blank' class='calendar-link' href='".$events[$s]['url']."'>".option('benediktengel.G-CalendarPlugin.linkName')."</a></p>";
}
} elseif (isset($events[$s]['description'])) {
if (option('benediktengel.G-CalendarPlugin.cutDescription') == true) {
echo "<p class='calendar-description'>".substr($events[$s]['description'], 0, option('benediktengel.G-CalendarPlugin.descriptionLength'))."... </p>";
} else {
echo "<p class='calendar-description'>".$events[$s]['description']."</p>";
}
} elseif (isset($events[$s]['url'])) {
echo "<a target='_blank' class='calendar-link' href='".$events[$s]['url']."'>".option('benediktengel.G-CalendarPlugin.linkName')."</a>";
}
Expand Down

0 comments on commit 7a5df3b

Please sign in to comment.