Skip to content

Commit

Permalink
Merge pull request #1061 from openeuropa/EWPP-2034
Browse files Browse the repository at this point in the history
EWPP-2034: Hide end date if same as start date and render time html e…
  • Loading branch information
upchuk authored Mar 16, 2022
2 parents b38f923 + e90956d commit af1a671
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
},
"drupal/entity_reference_revisions": {
"https://www.drupal.org/project/entity_reference_revisions/issues/2937835": "https://www.drupal.org/files/issues/2021-03-26/entity_reference_revisions-field_formatter_label-2937835-36.patch"
},
"drupal/datetime_range_timezone": {
"https://www.drupal.org/project/datetime_range_timezone/issues/3268321": "https://git.drupalcode.org/project/datetime_range_timezone/-/merge_requests/7.diff"
}
},
"drupal-scaffold": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@
*/
#}
<div class='daterange'>
<span class='daterange__date daterange__start-date'>{{ start_date }}</span>
<span class='daterange__date daterange__start-date'><time datetime="{{ iso_start_date }}">{{ start_date }}</time></span>

{% if separator is not empty %}
<span class='daterange__separtor'> {{ separator }} </span>
<span class='daterange__date daterange__end-date'>{{ end_date }}</span>
{% endif %}

{% if end_date is not empty %}
<span class='daterange__date daterange__end-date'><time datetime="{{ iso_end_date }}">{{ end_date }}</time></span>
{% endif %}

{% if timezone %}
<span class='daterange__timezone'> {{ timezone }}</span>
{% endif %}
{% if timezone %}
<span class='daterange__timezone'>{{ timezone }}</span>
{% endif %}
</div>
4 changes: 2 additions & 2 deletions tests/src/Functional/ContentEventRenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public function testEventRendering(): void {
'size' => 'm',
], [
'icon' => 'calendar',
'text' => '27 February 2020, 14:00 UTC - 27 February 2020, 14:00 UTC',
'text' => '27 February 2020, 14:00 UTC',
'size' => 'm',
],
],
Expand All @@ -247,7 +247,7 @@ public function testEventRendering(): void {
'items' => [
[
'label' => 'When',
'body' => 'Thursday 27 February 2020, 14:00 UTC - Thursday 27 February 2020, 14:00 UTC',
'body' => 'Thursday 27 February 2020, 14:00 UTC',
], [
'label' => 'Languages',
'body' => 'Estonian, French',
Expand Down

0 comments on commit af1a671

Please sign in to comment.