You are here

public function SearchApiDate::calculateResultFilter in Facets 8

Calculates the result of the filter.

Parameters

int $value: A unix timestamp.

Return value

array An array with a start and end date as unix timestamps.

Overrides QueryTypeRangeBase::calculateResultFilter

File

src/Plugin/facets/query_type/SearchApiDate.php, line 215

Class

SearchApiDate
Support for date facets within the Search API scope.

Namespace

Drupal\facets\Plugin\facets\query_type

Code

public function calculateResultFilter($value) {
  if ($this
    ->getDateDisplay() === 'relative_date') {
    return $this
      ->calculateResultFilterRelative($value);
  }
  else {
    return $this
      ->calculateResultFilterAbsolute($value);
  }
}