You are here

private function DateItemProcessor::granularityOptions in Facets 8

Human readable array of granularity options.

Return value

array An array of granularity options.

1 call to DateItemProcessor::granularityOptions()
DateItemProcessor::buildConfigurationForm in src/Plugin/facets/processor/DateItemProcessor.php
Adds a configuration form for this processor.

File

src/Plugin/facets/processor/DateItemProcessor.php, line 38

Class

DateItemProcessor
Provides a processor for dates.

Namespace

Drupal\facets\Plugin\facets\processor

Code

private function granularityOptions() {
  return [
    SearchApiDate::FACETAPI_DATE_YEAR => $this
      ->t('Year'),
    SearchApiDate::FACETAPI_DATE_MONTH => $this
      ->t('Month'),
    SearchApiDate::FACETAPI_DATE_DAY => $this
      ->t('Day'),
    SearchApiDate::FACETAPI_DATE_HOUR => $this
      ->t('Hour'),
    SearchApiDate::FACETAPI_DATE_MINUTE => $this
      ->t('Minute'),
    SearchApiDate::FACETAPI_DATE_SECOND => $this
      ->t('Second', [], [
      'context' => 'timeperiod',
    ]),
  ];
}