Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit a3a77822 authored by escuriola's avatar escuriola
Browse files

OEL-1653: Remove timezone_override settings.

parent 9ef3ecdd
No related branches found
No related tags found
1 merge request!158OEL-1653: Show time in event dates
......@@ -44,8 +44,7 @@ content:
oe_sc_event_dates:
type: event_date_range_format
label: inline
settings:
timezone_override: ''
settings: { }
third_party_settings: { }
weight: 1
region: content
......
......@@ -44,8 +44,7 @@ content:
oe_sc_event_dates:
type: event_date_range_format
label: inline
settings:
timezone_override: ''
settings: { }
third_party_settings: { }
weight: 1
region: content
......
......@@ -6,6 +6,7 @@ namespace Drupal\oe_whitelabel_starter_event\Plugin\Field\FieldFormatter;
use Drupal\Core\Datetime\DrupalDateTime;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\datetime\Plugin\Field\FieldFormatter\DateTimeFormatterBase;
use Drupal\datetime_range\DateTimeRangeTrait;
......@@ -27,6 +28,27 @@ class EventDateRangeFormatter extends DateTimeFormatterBase {
use DateTimeRangeTrait;
/**
* {@inheritdoc}
*/
public static function defaultSettings() {
return [];
}
/**
* {@inheritdoc}
*/
public function settingsForm(array $form, FormStateInterface $form_state) {
return [];
}
/**
* {@inheritdoc}
*/
public function settingsSummary() {
return [];
}
/**
* {@inheritdoc}
*/
......@@ -86,9 +108,7 @@ class EventDateRangeFormatter extends DateTimeFormatterBase {
* {@inheritdoc}
*/
protected function formatDate($date) {
$format_type = $this->getSetting('format_type');
$timezone = $this->getSetting('timezone_override') ?: $date->getTimezone()->getName();
return $this->dateFormatter->format($date->getTimestamp(), $format_type, '', $timezone != '' ? $timezone : NULL);
return $this->dateFormatter->format($date->getTimestamp(), 'custom', 'Y-m-d');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment