Skip to content

Commit

Permalink
Use configured end year or this year.
Browse files Browse the repository at this point in the history
  • Loading branch information
rosiel committed Nov 2, 2023
1 parent 5d704bd commit 3961168
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Plugin/search_api/processor/EDTFYear.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function addFieldValues(ItemInterface $item) {
}
else {
$end_year = (empty($this->configuration['open_end_year'])) ? date('Y') : $this->configuration['open_end_year'];
$edtf = str_replace('/..', '/' . $this->configuration['open_end_year'], $edtf);
$edtf = str_replace('/..', '/' . $end_year, $edtf);
}
}
// Open end dates with `/`.
Expand All @@ -192,7 +192,7 @@ public function addFieldValues(ItemInterface $item) {
}
else {
$end_year = (empty($this->configuration['open_end_year'])) ? date('Y') : $this->configuration['open_end_year'];
$edtf = str_replace('/', '/' . $this->configuration['open_end_year'], $edtf);
$edtf = str_replace('/', '/' . $end_year, $edtf);
}
}
$parsed = $parser->parse($edtf)->getEdtfValue();
Expand Down

0 comments on commit 3961168

Please sign in to comment.