diff --git a/composer.json b/composer.json
index ac7efd2b75..fbea6900ed 100644
--- a/composer.json
+++ b/composer.json
@@ -25,7 +25,7 @@
"drupal/composite_reference": "~1.0-alpha1",
"drupal/config_devel": "~1.2",
"drupal/datetime_testing": "1.x-dev",
- "drupal/description_list_field": "1.0.x-dev",
+ "drupal/description_list_field": "^1.0.0-alpha2",
"drupal/drupal-driver": "^2.1.1",
"drupal/drupal-extension": "~4.0",
"drupal/emr": "~1.0-beta9",
@@ -47,7 +47,7 @@
"openeuropa/behat-transformation-context": "~0.1",
"openeuropa/code-review": "~1.6",
"openeuropa/drupal-core-require-dev": "^8.9 || ^9.1",
- "openeuropa/oe_content": "dev-EPIC-EWPP-1539-Event-v2",
+ "openeuropa/oe_content": "dev-EWPP-1983",
"openeuropa/oe_corporate_blocks": "~4.0",
"openeuropa/oe_corporate_countries": "~2.0",
"openeuropa/oe_media": "~1.12",
diff --git a/modules/oe_theme_content_event/config/install/core.date_format.oe_event_long_date_hour_timezone.yml b/modules/oe_theme_content_event/config/install/core.date_format.oe_event_long_date_hour_timezone.yml
new file mode 100644
index 0000000000..3bb1d4bd7f
--- /dev/null
+++ b/modules/oe_theme_content_event/config/install/core.date_format.oe_event_long_date_hour_timezone.yml
@@ -0,0 +1,7 @@
+langcode: en
+status: true
+dependencies: { }
+id: oe_event_long_date_hour_timezone
+label: 'Event long date with hour and timezone'
+locked: false
+pattern: 'l j F Y, H:i T'
diff --git a/modules/oe_theme_content_event/config/install/core.date_format.oe_event_programme_date.yml b/modules/oe_theme_content_event/config/install/core.date_format.oe_event_programme_date.yml
deleted file mode 100644
index 9d02ec6b8c..0000000000
--- a/modules/oe_theme_content_event/config/install/core.date_format.oe_event_programme_date.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-langcode: en
-status: true
-dependencies: { }
-id: oe_event_programme_date
-label: 'Event programme date'
-locked: false
-pattern: 'j M Y'
diff --git a/modules/oe_theme_content_event/config/install/core.date_format.oe_event_programme_date_hour.yml b/modules/oe_theme_content_event/config/install/core.date_format.oe_event_programme_date_hour.yml
deleted file mode 100644
index 41218464ad..0000000000
--- a/modules/oe_theme_content_event/config/install/core.date_format.oe_event_programme_date_hour.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-langcode: en
-status: true
-dependencies: { }
-id: oe_event_programme_date_hour
-label: 'Event programme date with hour'
-locked: false
-pattern: 'j M Y, h:i A'
diff --git a/modules/oe_theme_content_event/config/install/core.date_format.oe_event_programme_date_hour_timezone.yml b/modules/oe_theme_content_event/config/install/core.date_format.oe_event_programme_date_hour_timezone.yml
new file mode 100644
index 0000000000..0f924baf1b
--- /dev/null
+++ b/modules/oe_theme_content_event/config/install/core.date_format.oe_event_programme_date_hour_timezone.yml
@@ -0,0 +1,7 @@
+langcode: en
+status: true
+dependencies: { }
+id: oe_event_programme_date_hour_timezone
+label: 'Event programme date with hour with timezone'
+locked: false
+pattern: 'j M Y, h:i A T'
diff --git a/modules/oe_theme_content_event/config/install/core.date_format.oe_event_programme_date_timezone.yml b/modules/oe_theme_content_event/config/install/core.date_format.oe_event_programme_date_timezone.yml
new file mode 100644
index 0000000000..7123d4b3b1
--- /dev/null
+++ b/modules/oe_theme_content_event/config/install/core.date_format.oe_event_programme_date_timezone.yml
@@ -0,0 +1,7 @@
+langcode: en
+status: true
+dependencies: { }
+id: oe_event_programme_date_timezone
+label: 'Event programme date with timezone'
+locked: false
+pattern: 'j M Y T'
diff --git a/modules/oe_theme_content_event/config/install/core.entity_view_display.node.oe_event.full.yml b/modules/oe_theme_content_event/config/install/core.entity_view_display.node.oe_event.full.yml
index 024fd1fdde..0a057650f3 100644
--- a/modules/oe_theme_content_event/config/install/core.entity_view_display.node.oe_event.full.yml
+++ b/modules/oe_theme_content_event/config/install/core.entity_view_display.node.oe_event.full.yml
@@ -175,11 +175,11 @@ content:
weight: 1
label: above
settings:
- timezone_override: ''
- format_type: oe_event_long_date_hour
+ display_timezone: false
+ format_type: oe_event_long_date_hour_timezone
separator: '-'
third_party_settings: { }
- type: daterange_default
+ type: daterange_timezone
region: content
oe_event_entrance_fee:
weight: 9
diff --git a/modules/oe_theme_content_event/config/post_updates/30001_update_full_view_display/core.date_format.oe_event_long_date_hour_timezone.yml b/modules/oe_theme_content_event/config/post_updates/30001_update_full_view_display/core.date_format.oe_event_long_date_hour_timezone.yml
new file mode 100644
index 0000000000..3bb1d4bd7f
--- /dev/null
+++ b/modules/oe_theme_content_event/config/post_updates/30001_update_full_view_display/core.date_format.oe_event_long_date_hour_timezone.yml
@@ -0,0 +1,7 @@
+langcode: en
+status: true
+dependencies: { }
+id: oe_event_long_date_hour_timezone
+label: 'Event long date with hour and timezone'
+locked: false
+pattern: 'l j F Y, H:i T'
diff --git a/modules/oe_theme_content_event/config/post_updates/30001_update_full_view_display/core.date_format.oe_event_programme_date_hour_timezone.yml b/modules/oe_theme_content_event/config/post_updates/30001_update_full_view_display/core.date_format.oe_event_programme_date_hour_timezone.yml
new file mode 100644
index 0000000000..0f924baf1b
--- /dev/null
+++ b/modules/oe_theme_content_event/config/post_updates/30001_update_full_view_display/core.date_format.oe_event_programme_date_hour_timezone.yml
@@ -0,0 +1,7 @@
+langcode: en
+status: true
+dependencies: { }
+id: oe_event_programme_date_hour_timezone
+label: 'Event programme date with hour with timezone'
+locked: false
+pattern: 'j M Y, h:i A T'
diff --git a/modules/oe_theme_content_event/config/post_updates/30001_update_full_view_display/core.date_format.oe_event_programme_date_timezone.yml b/modules/oe_theme_content_event/config/post_updates/30001_update_full_view_display/core.date_format.oe_event_programme_date_timezone.yml
new file mode 100644
index 0000000000..7123d4b3b1
--- /dev/null
+++ b/modules/oe_theme_content_event/config/post_updates/30001_update_full_view_display/core.date_format.oe_event_programme_date_timezone.yml
@@ -0,0 +1,7 @@
+langcode: en
+status: true
+dependencies: { }
+id: oe_event_programme_date_timezone
+label: 'Event programme date with timezone'
+locked: false
+pattern: 'j M Y T'
diff --git a/modules/oe_theme_content_event/config/post_updates/30001_update_full_view_display/core.entity_view_display.node.oe_event.full.yml b/modules/oe_theme_content_event/config/post_updates/30001_update_full_view_display/core.entity_view_display.node.oe_event.full.yml
index 024fd1fdde..88311e7927 100644
--- a/modules/oe_theme_content_event/config/post_updates/30001_update_full_view_display/core.entity_view_display.node.oe_event.full.yml
+++ b/modules/oe_theme_content_event/config/post_updates/30001_update_full_view_display/core.entity_view_display.node.oe_event.full.yml
@@ -41,6 +41,7 @@ dependencies:
- node.type.oe_event
module:
- datetime_range
+ - datetime_range_timezone
- entity_reference_revisions
- field_group
- link
@@ -175,11 +176,11 @@ content:
weight: 1
label: above
settings:
- timezone_override: ''
- format_type: oe_event_long_date_hour
+ display_timezone: false
+ format_type: oe_event_long_date_hour_timezone
separator: '-'
third_party_settings: { }
- type: daterange_default
+ type: daterange_timezone
region: content
oe_event_entrance_fee:
weight: 9
diff --git a/modules/oe_theme_content_event/oe_theme_content_event.post_update.php b/modules/oe_theme_content_event/oe_theme_content_event.post_update.php
index fbd1e06908..bb61404856 100644
--- a/modules/oe_theme_content_event/oe_theme_content_event.post_update.php
+++ b/modules/oe_theme_content_event/oe_theme_content_event.post_update.php
@@ -108,6 +108,9 @@ function oe_theme_content_event_post_update_30001() {
'core.date_format.oe_event_programme_date',
'core.date_format.oe_event_programme_date_hour',
'core.date_format.oe_event_programme_hour',
+ 'core.date_format.oe_event_programme_date_timezone',
+ 'core.date_format.oe_event_programme_date_hour_timezone',
+ 'core.date_format.oe_event_long_date_hour_timezone',
];
foreach ($date_formats as $date_format_name) {
$config = $storage->read($date_format_name);
diff --git a/modules/oe_theme_content_event/src/Plugin/ExtraField/Display/DetailsExtraField.php b/modules/oe_theme_content_event/src/Plugin/ExtraField/Display/DetailsExtraField.php
index 84dcb4e97a..b3983e8be4 100755
--- a/modules/oe_theme_content_event/src/Plugin/ExtraField/Display/DetailsExtraField.php
+++ b/modules/oe_theme_content_event/src/Plugin/ExtraField/Display/DetailsExtraField.php
@@ -144,10 +144,11 @@ protected function getRenderableSubject(ContentEntityInterface $entity): array {
protected function getRenderableDates(ContentEntityInterface $entity): array {
return $this->entityTypeManager->getViewBuilder('node')->viewField($entity->get('oe_event_dates'), [
'label' => 'hidden',
- 'type' => 'daterange_default',
+ 'type' => 'daterange_timezone',
'settings' => [
- 'format_type' => 'oe_event_date_hour',
+ 'format_type' => 'oe_event_date_hour_timezone',
'separator' => '-',
+ 'display_timezone' => FALSE,
],
]);
}
diff --git a/modules/oe_theme_content_event/src/Plugin/ExtraField/Display/ProgrammeExtraField.php b/modules/oe_theme_content_event/src/Plugin/ExtraField/Display/ProgrammeExtraField.php
index 49b1efb7b0..07cdc9d218 100755
--- a/modules/oe_theme_content_event/src/Plugin/ExtraField/Display/ProgrammeExtraField.php
+++ b/modules/oe_theme_content_event/src/Plugin/ExtraField/Display/ProgrammeExtraField.php
@@ -32,12 +32,12 @@ class ProgrammeExtraField extends EventExtraFieldBase {
/**
* Programme datetime format.
*/
- const PROGRAMME_DATETIME_FORMAT = 'oe_event_programme_date_hour';
+ const PROGRAMME_DATETIME_FORMAT = 'oe_event_programme_date_hour_timezone';
/**
* Programme date format.
*/
- const PROGRAMME_DATE_FORMAT = 'oe_event_programme_date';
+ const PROGRAMME_DATE_FORMAT = 'oe_event_programme_date_timezone';
/**
* Programme time format.
@@ -186,6 +186,7 @@ public function viewElements(ContentEntityInterface $entity) {
protected function generateEventProgrammeLabel(ProgrammeItemInterface $programme, ?string $previous_end_date = NULL): ?array {
$start_datetime = $programme->get('oe_event_programme_dates')->start_date;
$end_datetime = $programme->get('oe_event_programme_dates')->end_date;
+ $timezone = $programme->get('oe_event_programme_dates')->timezone;
$start_day = $this->dateFormatter->format($start_datetime->getTimestamp(), 'custom', 'Ymd');
$end_day = $this->dateFormatter->format($end_datetime->getTimestamp(), 'custom', 'Ymd');
@@ -196,16 +197,16 @@ protected function generateEventProgrammeLabel(ProgrammeItemInterface $programme
$end_date_format = $start_day === $end_day ? self::PROGRAMME_TIME_FORMAT : self::PROGRAMME_DATETIME_FORMAT;
$template = '{% trans %}{{ start_date }} - {{ end_date }}{% endtrans %}';
$context = [
- 'start_date' => $this->dateFormatter->format($start_datetime->getTimestamp(), $start_date_format),
- 'end_date' => $this->dateFormatter->format($end_datetime->getTimestamp(), $end_date_format),
+ 'start_date' => $this->dateFormatter->format($start_datetime->getTimestamp(), $start_date_format, '', $timezone),
+ 'end_date' => $this->dateFormatter->format($end_datetime->getTimestamp(), $end_date_format, '', $timezone),
];
// If the event program item running within 1 day and there are no
// other event program items in the current day coming before,
// show the date with time range within a day.
if ($start_date_format === self::PROGRAMME_DATETIME_FORMAT && $end_date_format === self::PROGRAMME_TIME_FORMAT) {
$template = '{% trans %}{{ start_day }},
{{ start_date }} - {{ end_date }}{% endtrans %}';
- $context['start_day'] = $this->dateFormatter->format($start_datetime->getTimestamp(), self::PROGRAMME_DATE_FORMAT);
- $context['start_date'] = $this->dateFormatter->format($start_datetime->getTimestamp(), self::PROGRAMME_TIME_FORMAT);
+ $context['start_day'] = $this->dateFormatter->format($start_datetime->getTimestamp(), self::PROGRAMME_DATE_FORMAT, '', $timezone);
+ $context['start_date'] = $this->dateFormatter->format($start_datetime->getTimestamp(), self::PROGRAMME_TIME_FORMAT, '', $timezone);
}
return [
diff --git a/modules/oe_theme_content_event/src/Plugin/ExtraField/Display/RegistrationButtonExtraField.php b/modules/oe_theme_content_event/src/Plugin/ExtraField/Display/RegistrationButtonExtraField.php
index fa385e47dd..b2c9714c87 100644
--- a/modules/oe_theme_content_event/src/Plugin/ExtraField/Display/RegistrationButtonExtraField.php
+++ b/modules/oe_theme_content_event/src/Plugin/ExtraField/Display/RegistrationButtonExtraField.php
@@ -110,15 +110,15 @@ public function viewElements(ContentEntityInterface $entity) {
// show different message.
if ($datetime_start->format('Ymd') === $request_datetime->format('Ymd')) {
$build['#description'] = $this->t('Registration will open today, @start_date.', [
- '@start_date' => $this->dateFormatter->format($datetime_start->getTimestamp(), 'oe_event_date_hour'),
+ '@start_date' => $this->dateFormatter->format($datetime_start->getTimestamp(), 'oe_event_date_hour_timezone', '', $event->getRegistrationTimezone()),
]);
}
else {
$date_diff_formatted = $this->dateFormatter->formatDiff($this->requestTime, $datetime_start->getTimestamp(), ['granularity' => 1]);
$build['#description'] = $this->t('Registration will open in @time_left. You can register from @start_date, until @end_date.', [
'@time_left' => $date_diff_formatted,
- '@start_date' => $this->dateFormatter->format($datetime_start->getTimestamp(), 'oe_event_date_hour'),
- '@end_date' => $this->dateFormatter->format($datetime_end->getTimestamp(), 'oe_event_date_hour'),
+ '@start_date' => $this->dateFormatter->format($datetime_start->getTimestamp(), 'oe_event_date_hour_timezone', '', $event->getRegistrationTimezone()),
+ '@end_date' => $this->dateFormatter->format($datetime_end->getTimestamp(), 'oe_event_date_hour_timezone', '', $event->getRegistrationTimezone()),
]);
}
@@ -144,14 +144,14 @@ public function viewElements(ContentEntityInterface $entity) {
// show different message.
if ($datetime_end->format('Ymd') === $request_datetime->format('Ymd')) {
$build['#description'] = $this->t('Book your seat, the registration will end today, @end_date', [
- '@end_date' => $this->dateFormatter->format($datetime_end->getTimestamp(), 'oe_event_date_hour'),
+ '@end_date' => $this->dateFormatter->format($datetime_end->getTimestamp(), 'oe_event_date_hour_timezone', '', $event->getRegistrationTimezone()),
]);
}
else {
$date_diff_formatted = $this->dateFormatter->formatDiff($this->requestTime, $datetime_end->getTimestamp(), ['granularity' => 1]);
$build['#description'] = $this->t('Book your seat, @time_left left to register, registration will end on @end_date', [
'@time_left' => $date_diff_formatted,
- '@end_date' => $this->dateFormatter->format($datetime_end->getTimestamp(), 'oe_event_date_hour'),
+ '@end_date' => $this->dateFormatter->format($datetime_end->getTimestamp(), 'oe_event_date_hour_timezone', '', $event->getRegistrationTimezone()),
]);
}
@@ -167,7 +167,7 @@ public function viewElements(ContentEntityInterface $entity) {
if ($event->isRegistrationPeriodOver($this->requestDateTime)) {
$datetime_end = $event->getRegistrationEndDate();
$build['#description'] = $this->t('Registration period ended on @date', [
- '@date' => $this->dateFormatter->format($datetime_end->getTimestamp(), 'oe_event_long_date_hour'),
+ '@date' => $this->dateFormatter->format($datetime_end->getTimestamp(), 'oe_event_long_date_hour_timezone', '', $event->getRegistrationTimezone()),
]);
$build['#show_button'] = FALSE;
diff --git a/modules/oe_theme_content_event/templates/datetime-range-timezone.html.twig b/modules/oe_theme_content_event/templates/datetime-range-timezone.html.twig
new file mode 100644
index 0000000000..375ca1affc
--- /dev/null
+++ b/modules/oe_theme_content_event/templates/datetime-range-timezone.html.twig
@@ -0,0 +1,17 @@
+{#
+/**
+ * @file
+ * Theme override for the datetime-range-timezone template.
+ *
+ * @see \Drupal\datetime_range_timezone\Plugin\Field\FieldFormatter\DateRangeTimezone::viewElements()
+ */
+#}
+