Skip to content

Commit

Permalink
v3.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
kjmartens committed Oct 23, 2020
1 parent 05a3131 commit 7c4d42f
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Solspace Calendar Changelog

## 3.0.14 - 2020-10-23
### Added
- Added `previousDateLocalized` and `nextDateLocalized` property as a more reliable replacement for `previousDate` and `nextDate` when needing to use `|date` filter on `month`/`week`/`day` objects to display translatable dates in calendar views.

### Fixed
- Fixed a bug where Live Preview was not working correctly for non-Calendar fields in Craft 3.5+.

## 3.0.13 - 2020-10-06
### Fixed
- Fixed a bug where the Occurrences object's default was not loading correctly for some recurring events.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "solspace/craft3-calendar",
"description": "The most reliable and powerful event management plugin for Craft.",
"version": "3.0.13",
"version": "3.0.14",
"type": "craft-plugin",
"authors": [
{
Expand Down
2 changes: 1 addition & 1 deletion src/Controllers/EventsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ private function renderEditForm(Event $event, string $title): Response
if (!\Craft::$app->getRequest()->isMobileBrowser(true) && $this->getCalendarService()->isEventTemplateValid($calendar, $event->siteId)) {
$previewUrl = $event->getUrl();
$this->getView()->registerJs('Craft.LivePreview.init(' . Json::encode([
'fields' => '#title-field, #event-builder-data, #event-builder, #fields .calendar-event-wrapper > .field, #fields > .field > .field',
'fields' => '#title-field, #event-builder-data, #event-builder, #fields .calendar-event-wrapper > .field, #fields > .field > .field, #fields > .flex-fields > .field',
'extraFields' => '#settings',
'previewUrl' => $previewUrl,
'previewAction' => $previewActionUrl,
Expand Down
16 changes: 16 additions & 0 deletions src/Library/Events/AbstractEventCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ final public function getPreviousDate(): Carbon
return $this->getDate()->copy()->sub($this->getInterval());
}

/**
* @return Carbon
*/
final public function getPreviousDateLocalized(): Carbon
{
return $this->getDateLocalized()->copy()->sub($this->getInterval());
}

/**
* Returns a Carbon object with the duration interval set forward by 1 iteration
*
Expand All @@ -115,6 +123,14 @@ final public function getNextDate(): Carbon
return $this->getDate()->copy()->add($this->getInterval());
}

/**
* @return Carbon
*/
final public function getNextDateLocalized(): Carbon
{
return $this->getDateLocalized()->copy()->add($this->getInterval());
}

/**
* Returns a list of dates
* The dates begin $before intervals from self::$date
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/css/src/calendar.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Resources/css/src/widget/agenda.css

Large diffs are not rendered by default.

0 comments on commit 7c4d42f

Please sign in to comment.