Skip to content

Commit

Permalink
v2.0.18
Browse files Browse the repository at this point in the history
  • Loading branch information
kjmartens committed Apr 5, 2019
1 parent b3e6f75 commit 068d118
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Solspace Calendar Changelog

## 2.0.18 - 2019-04-05
### Fixed
- Fixed a bug where events that started early in day but repeated daily and ended on a specific date would error due to timezone issues.
- Fixed a bug where an error would be triggered by Postgres when creating an Upcoming Events widget.
- Fixed a bug where demo templates were not correctly handling multi-day all-day events in the Month view.

## 2.0.17 - 2019-03-13
### Fixed
- Fixed a bug where the Share button token feature was not working on disabled events for logged out users.
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "solspace/craft3-calendar",
"description": "The most powerful event management plugin for Craft.",
"version": "2.0.17",
"version": "2.0.18",
"type": "craft-plugin",
"authors": [
{
Expand Down Expand Up @@ -30,7 +30,7 @@
"class": "Solspace\\Calendar\\Calendar",
"name": "Calendar",
"developer": "Solspace",
"developerUrl": "https://solspace.com/craft/calendar",
"developerUrl": "http://docs.solspace.com/craft/calendar/v2/",
"documentationUrl": "http://docs.solspace.com/craft/calendar/v2/",
"changelogUrl": "https://raw.githubusercontent.com/solspace/craft3-calendar/master/CHANGELOG.md",
"hasSettings": true,
Expand Down
12 changes: 10 additions & 2 deletions src/Elements/Db/EventQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,12 @@ protected function beforePrepare(): bool
$this->query->select($select);

if ($this->calendarId) {
$this->subQuery->andWhere(Db::parseParam($table . '.[[calendarId]]', $this->calendarId));
$isWildcard = $this->calendarId === '*' ||
(is_array($this->calendarId) && count($this->calendarId) === 1 && $this->calendarId[0] === '*');

if (!$isWildcard) {
$this->subQuery->andWhere(Db::parseParam($table . '.[[calendarId]]', $this->calendarId));
}
}

if ($this->calendar) {
Expand Down Expand Up @@ -1030,7 +1035,7 @@ private function getPaddedRangeStart($relativeDate = null)

/**
* @param Carbon|string|null $relativeDate
* @param string $recurrenceFrequency
* @param string $recurrenceFrequency
*
* @return Carbon|null
*/
Expand Down Expand Up @@ -1080,6 +1085,9 @@ private function getRRuleFromEventMetadata($eventMetadata)
$until = $eventMetadata['until'];

$startDate = new Carbon($startDate, DateHelper::UTC);
if ($until) {
$until = new Carbon($until, DateHelper::UTC);
}

try {
return new RRule(
Expand Down
6 changes: 3 additions & 3 deletions src/codepack/templates/layouts/_event.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
{% set classes = classes ~ (event.allDay ? " all_day") %}
{% if event.multiDay %}
{% set classes = classes ~ " multi_day" %}
{% set classes = classes ~ (day.containsDate(event.startDate) ? " first_day") %}
{% set classes = classes ~ (day.containsDate(event.endDate.copy.minute(-1)) ? " last_day") %}
{% set classes = classes ~ (day.containsDate(event.startDateLocalized) ? " first_day") %}
{% set classes = classes ~ (day.containsDate(event.endDateLocalized) ? " last_day") %}
{% endif %}

{% set style = "" %}
Expand All @@ -19,7 +19,7 @@
<a href="{{ siteUrl }}demo/event/{{ event.id }}/{{ event.repeating ? event.startDate.format('Y/m/d') }}"
style="color: {{ event.calendar.contrastColor }} !important;">
{% autoescape false %}
{{ day.containsDate(event.startDate) or day.containsDate(event.endDate) ? event.title : "&nbsp;"|raw }}
{{ day.containsDate(event.startDateLocalized) or day.containsDate(event.endDateLocalized) ? event.title : "&nbsp;"|raw }}
{% endautoescape %}
</a>
{% else %}
Expand Down

0 comments on commit 068d118

Please sign in to comment.