Skip to content

Commit

Permalink
Merge pull request #96 from Islandora/adam-vessey-patch-1
Browse files Browse the repository at this point in the history
(Re)initialize `$formatted_dates`.
  • Loading branch information
rosiel authored Apr 26, 2023
2 parents d60e84f + 1df2729 commit 344d546
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Plugin/Field/FieldFormatter/EDTFFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
// Sets.
if (strpos($item->value, '[') !== FALSE || strpos($item->value, '{') !== FALSE) {
$set_qualifier = (strpos($item->value, '[') !== FALSE) ? t('one of the dates:') : t('all of the dates:');
$formatted_dates = [];
foreach (explode(',', trim($item->value, '{}[] ')) as $date) {
$date_range = explode('..', $date);
switch (count($date_range)) {
Expand Down

0 comments on commit 344d546

Please sign in to comment.